Submission #19322

# Submission time Handle Problem Language Result Execution time Memory
19322 2016-02-24T09:42:52 Z isac322 Α (kriii4_P1) C++14
0 / 100
0 ms 1084 KB
#include <cstdio>
#include <algorithm>

using namespace std;

const long long MOD = 1000000007;
long long a, x;

long long solve(long long n) {
	if (n == 1) return a;
	long long ret = solve(n >> 1);
	return (((ret*ret) % MOD) * (n & 1LL ? a : 1LL)) % MOD;
}

int main() {
	scanf("%lld%lld", &a, &x);
	printf("%lld", solve(x));
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Halted 0 ms 0 KB -