Cod sursa(job #2070358)
Utilizator | Vlad Haivas vladth11 | Data | 19 noiembrie 2017 14:31:52 |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
using namespace std;
ifstream cin("cmmdc.in");
ofstream cout("cmmdc.out");
int main()
{
int n,p,rez;
cin >> n >> p;
rez = 1;
while(p > 0){
rez = rez*n;
p--;
}
cout << (long long)rez % 1999999973;
return 0;
}