# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19514 | panda959595 | Α (kriii4_P1) | C++98 | 1000 ms | 1712 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |