Cod sursa(job #2929624)
| Utilizator | Data | 26 octombrie 2022 12:45:38 | |
|---|---|---|---|
| Problema | Evaluarea unei expresii | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.39 kb |
#include <bits/stdc++.h>
#define MOD 1999999973
#define N 30
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n, p;
int Power(int n, int p) {
if (p == 0) return 1;
else if (p % 2 == 1)
return (1LL*n * Power(n, p - 1))%MOD;
int P = Power(n, p / 2);
return (1LL*P * P)%MOD;
}
int main() {
fin >> n >> p;
fout<<Power(n, p);
return 0;
}