Cod sursa(job #1509767)
Utilizator | Data | 24 octombrie 2015 12:08:42 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.25 kb |
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
int main()
{
long p,n;
f>>n;
f>>p;
long x=n;
for(int i=1;i<p;i++)
{
n=(n*x)%1999999973;
}
g<<n;
return 0;
}