0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 12:18:50 +00:00
Baoshuo Ren 2021-10-03 11:20:47 +08:00 committed by Baoshuo Ren
parent fdb7b7a070
commit ae929e4eb6
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

17
AcWing/89/89.cpp Normal file
View File

@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using namespace std;
long long a, b, p, ans = 1;
int main() {
cin >> a >> b >> p;
a %= p;
while (b) {
if (b & 1) ans = ans * a % p;
a = a * a % p;
b >>= 1;
}
cout << ans % p << endl;
return 0;
}