# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19610 | chan492811 | Α (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 <cstdio>
#include <algorithm>
#define mod 1000000007
#define ll long long
using namespace std;
ll table[100];
void make_table(ll a){
ll i;
table[0]=a%mod;
for(i=1;i<100;i++) table[i]=(table[i-1]*table[i-1])%mod;
}
int main(){
ll i,a,s,res=1,now;
scanf("%lld %lld",&a,&s);
make_table(a); now=1;
for(i=0;s;i++){
if(s&now) res*=table[i],res%=mod,s-=now;
now*=2;
}
printf("%lld",res);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |