Cod sursa(job #265869)
| Utilizator | Data | 24 februarie 2009 17:37:10 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.32 kb |
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
long n, p, s;
int i;
ifstream f("lgput.in");
f>>n>>p;
f.close();
s=n;
for(i=2;i<=p;i++)
s=s*n;
ofstream g("lgput.out");
g<<s%1999999973;
g.close();
return 0;
}
