# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3770 | pl0892029 | Great Pow! (kriii1_G) | C++98 | 0 ms | 0 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>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main(void){
int a, k;
scanf("%d %d", &a, &k);
__int64 res = a;
for(int i=0; i<k+1; i++){
res=pow((double)res, a);
}
printf("%d", res%(a+1));
}