# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19400 | inspire12 | Α (kriii4_P1) | C++98 | 1000 ms | 1080 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |