Cod sursa(job #3141058)
Utilizator | Data | 12 iulie 2023 08:23:43 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const long long DIVISOR = 1999999973;
int main() {
int n, p;
fin >> n >> p;
int nCopy = n;
for (int i = 2; i <= p; ++i) {
nCopy *= n;
}
fout << nCopy % DIVISOR;
return 0;
}