Pagini recente » Cod sursa (job #2694079) | Cod sursa (job #2405898) | Cod sursa (job #3233665) | Cod sursa (job #573729) | Cod sursa (job #3284477)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long ExpoLog(long long a, long long n, int mod)
{
int p = 1;
while(n > 0)
{
if(n % 2 == 1) p = 1LL * p * a % mod;
n /= 2;
a = 1LL * a * a % mod;
}
return p;
}
int main()
{
ios_base::sync_with_stdio(0);
fin.tie(0);
fout.tie(0);
int n,p;
fin >> n >> p;
fout << 1LL * ExpoLog(n,p, 1999999973);
return 0;
}