Submission #3545

#TimeUsernameProblemLanguageResultExecution timeMemory
3545eldkqmfhf123Great Pow! (kriii1_G)C++98
0 / 1
0 ms1852 KiB
#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

int main(void){

	int a, k, val, res=1;
	int i, j;

	cin >>a >>k;

	val = pow(a, a);

	for(i=0; i<k; i++)
		val = (int)pow(val, a) % (a+1);

	cout <<val <<endl;

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...