Cod sursa(job #3141056)
Utilizator | Data | 12 iulie 2023 08:18:15 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.26 kb |
#include <iostream>
using namespace std;
const long long DIVISOR = 1999999973;
int main() {
int n, p;
cin >> n >> p;
int nCopy = n;
while (p > 1) {
--p;
nCopy *= n;
}
cout << nCopy % DIVISOR;
return 0;
}