Submission #19514

#TimeUsernameProblemLanguageResultExecution timeMemory
19514panda959595Α (kriii4_P1)C++98
0 / 100
1000 ms1712 KiB
#include <string> #include <cmath> #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <list> #include <stdio.h> #include <string.h> using namespace std; int main() { long long a, b; long long k; cin >> a >> b; int num; a %= 1000000007; while (1) { num = a; if (b == 1) break; for (int i = 2; i <= b; i++) { if (b%i == 0) { k = i; break; } } b /= k; for (int i = 1; i < k; i++) { a = a*num; a %= 1000000007; } } cout << a << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...