Algorithm_ZRF @ 2023-07-31 20:39:50
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d;
inline void input() {
cin >> a >> b;
}
inline void compute(){
c = 1;
d = a;
for (int i = 2;i <= b;++i){
c += a % 9901;
a *= d;
}
c += a % 9901;
c = c % 9901;
cout << c;
}
int main() {
input();
compute();
return 0;
}
by DAKnell @ 2024-08-07 18:03:45
a不一定是质数