Submission #19400

#TimeUsernameProblemLanguageResultExecution timeMemory
19400inspire12Α (kriii4_P1)C++98
0 / 100
1000 ms1080 KiB
#include <cstdio> int main() { long long n; long long m; int i; long long x = 0; scanf("%lld", &n); scanf("%lld", &m); for (i = 1000000000; i >= 1; i /= 2) { if (m - i > 0) m -= i, x += i; if (m - i == 0) { x += i; break; } } unsigned long long res = 1; for (i = 1; i <= x; i++) { res = (res * n) % 1000000007; } printf("%lld", res % 1000000007); }
#Verdict Execution timeMemoryGrader output
Fetching results...