# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19563 | suzy | Α (kriii4_P1) | C++98 | 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 <stdio.h>
#define MOD 1000000007
typedef long long lli;
lli f(lli a, lli x) {
if(x==0) return 1;
if(x%2) return a*f(a,x-1)%MOD;
else { lli m=f(a,x/2); return m*m%MOD; }
}
int main() {
lli a, x;
scanf("%lld %lld",&a,&x);
a%=MOD;
printf("%lld",f(a,x));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |