快速幂取模
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int qmi(int a,int b,int c) {
int res = 1 % c;// 防止 c == 1,b == 0
while(b) {
if(b & 1) res = (LL)res * a % c;
a = (LL)a * a % c;
b >>= 1;
}
return res;
}
int main() {
int a,b,c;
cin >> a >> b >> c;
cout << qmi(a,b,c);
return 0;
}