# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19529 | metadata | Α (kriii4_P1) | C++14 | 0 ms | 1084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#define MOD 1000000007
long long mod_bp[65];
long long A,X,r;
int main(){
scanf("%lld %lld",&A,&X);
mod_bp[0]=A%MOD;
int i;
for(i=1;i<64 && (1<<i)<=X;i++){
mod_bp[i]=(mod_bp[i-1]*mod_bp[i-1])%MOD;
}
for(i=0,r=1;i<64 && (1<<i)<=X;i++){
if((1<<i)&X){
r*=mod_bp[i];
r%=MOD;
}
}
printf("%lld",r);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |