Cod sursa(job #962038)
Utilizator | Data | 13 iunie 2013 18:12:02 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.29 kb |
#define ll long long
#include<fstream>
using namespace std;
ll prod=1;
unsigned int n,p;
const int M=1999999973;
ifstream f("lgput.in");
ofstream g("lgput.out");
int main()
{ f>>n>>p;
while(p--)
prod=prod*n%M;
g<<prod<<'\n';
g.close();
return 0;
}