Cod sursa(job #2979158)
Utilizator | Data | 14 februarie 2023 20:02:31 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main()
{
long long n, p;
fin >> n >> p;
long long np = 1;
for(long long i = 1; i <= p; i++){
np = (np*n)%1999999973;
}
fout << np;
return 0;
}