Cod sursa(job #1318936)
Utilizator | Data | 16 ianuarie 2015 15:02:18 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.32 kb |
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main()
{
long long N,P,a,M,y,x,i;
fin>>N>>P;
M=1999999973;
x=N%M;
y=1;
for(i=1;i<=P;i++)
{
y=(y*x)%M;
}
fout<<y;
fin.close();
fout.close();
return 0;
}