Cod sursa(job #477202)
Utilizator | Data | 13 august 2010 19:42:04 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include<fstream>
#include<iostream>
using namespace std;
const unsigned long X=1999999973;
int main()
{
unsigned int N,P;
long long rez=1;
fstream fin("lgput.in",fstream::in);
fstream fout("lgput.out",fstream::out);
fin>>N>>P;
for(int i=0;i<P;i++)
{
rez=(rez*N)%X;
}
fin.close();
fout<<rez<<endl;
fout.close();
return 0;
}