#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1000 ms |
1712 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |