Pagini recente » Cod sursa (job #2554289) | Cod sursa (job #2487938) | Cod sursa (job #1823666) | Diferente pentru problema/fences intre reviziile 9 si 21 | Cod sursa (job #2841175)
#include <bits/stdc++.h>
#define MOD 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n, p;
int power(int n, int p)
{
int x = 1;
while(p>0)
{
if(p%2==1)
{
x = 1LL * x * n % MOD;
}
p /= 2;
n = 1LL * n * n % MOD;
}
return x;
}
int main()
{
fin >> n >> p;
fout << power(n, p);
return 0;
}