Pagini recente » Cod sursa (job #1234229) | Cod sursa (job #722901) | Cod sursa (job #1398841) | Cod sursa (job #722982) | Cod sursa (job #2590620)
#include <iostream>
#include <fstream>
using namespace std;
long long int ridicare_logaritmica(long long int N, long long int P)
{
long long int r=1;
while(P)
{
if(P%2==1)
r*=N;
N=N*N;
P/=2;
}
return r;
}
int main()
{
ifstream f("lgput.in");
ofstream g("lgput.out");
long long int N, P;
f>>N>>P;
int MOD=1999999973;
long long solutie=ridicare_logaritmica(N, P);
solutie=solutie%MOD;
g<<solutie;
return 0;
}