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