Submission #4311

# Submission time Handle Problem Language Result Execution time Memory
4311 2013-09-12T09:04:35 Z zorrapower Great Pow! (kriii1_G) C++
0 / 1
9028 ms 1088 KB
#include<stdio.h>
int pow(int low, int exp);

int main(void)
{
	int a, k, exp;
	scanf("%d %d", &a, &k);
	exp=a;
	for(int i=1; i<=k; i++){
		exp=pow(a, exp);
	}

	printf("%d", exp%(a+1));


	return 0;
}

int pow(int low, int exp){
	int result=1;
	for(int i=0; i<exp; i++)
		result*=low;

	return result;

}
# Verdict Execution time Memory Grader output
1 Correct 9028 ms 1088 KB Output is correct
2 Incorrect 0 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -