mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-09 16:58:48 +00:00
P4144 大河的序列
R55005183
This commit is contained in:
parent
14ef00da69
commit
174a44ee47
27
Luogu/problem/P4144/P4144.cpp
Normal file
27
Luogu/problem/P4144/P4144.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, b;
|
||||
long long p, a, x;
|
||||
|
||||
long long binpow(long long a, long long b, long long m) {
|
||||
a %= m;
|
||||
long long res = 1;
|
||||
while (b > 0) {
|
||||
if (b & 1) res = res * a % m;
|
||||
a = a * a % m;
|
||||
b >>= 1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main() {
|
||||
cin >> n >> b >> p;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a;
|
||||
x = max(a, x);
|
||||
}
|
||||
cout << binpow(2 * x + 233, b, p) % p << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user