Pagini recente » Cod sursa (job #3172770) | Cod sursa (job #2135470) | Cod sursa (job #198395) | Atasamentele paginii Algoritmiada 2015 - Runda Finală, Regulament | Cod sursa (job #2986698)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int e=1999999973;
int log(long long x,long long n)
{
long long f=1;
while(n)
{
if(n%2==1)
f=((f%e)*x)%e;
x=(x*x)%e;
n=n/2;
}
return f%e;
}
int main()
{
int N,P;
fin>>N>>P;
fout<<log(N,P);
return 0;
}