Cod sursa(job #2638812)
| Utilizator | Data | 30 iulie 2020 00:30:08 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
int MOD = 1999999973;
int lgput(int x, int n) {
} else if (n == 1) {
return x;
} else if (n % 2 == 0) {
return lgput (1LL * x * x % MOD, n / 2);
} else {
return 1LL * x * lgput(x * x, (n - 1)/2) % MOD;
}
}
int main()
{
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n, p, remainder;
fin >> n >> p;
fout << remainder;
return 0;
}
