Submission #19621

# Submission time Handle Problem Language Result Execution time Memory
19621 2016-02-25T02:28:46 Z 201023777 Α (kriii4_P1) C
0 / 100
0 ms 1084 KB
#include <stdio.h>
 
long long int a,b,c;

int yukariko(long long int A,long long int B){
    if(B==0) return 1;
    if(B==1) return A%c;
    if(B%2==0) return yukariko((A*A)%c,B/2);
    else return (A*yukariko((A*A)%c,(B-1)/2))%c;
}
 
int main(){
	c=1000000007;
    scanf("%lld%lld",&a,&b);
    printf("%d",yukariko(a,b));
     
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Halted 0 ms 0 KB -