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 N 1000000007
long long int dt[1000005];
int main()
{
long long int a,b,z,x;
scanf("%lld %lld",&a,&b);
dt[1]=a;
dt[2]=(a*a+a)%N;
for(z=3;z<=b;z++){
dt[z]=(dt[z-1]*a)%N;
for(x=1;x!=z;x++)
dt[z]=(dt[z]*dt[x])%N;
}
printf("%d",dt[b]);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |