Pagini recente » Diferente pentru problema/saracsaurege intre reviziile 7 si 8 | Diferente pentru echipa-infoarena intre reviziile 129 si 98 | Atasamentele paginii Geometrie | Statistici Micu Alexandra Cristina (Cristina_Micu0731) | Cod sursa (job #1800244)
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1999999973;
ifstream fin("lgput.in");
ofstream fout("lgout.out");
long long pow(long long x, long long n) {
int y = 1;
while (x > 1) {
if (n % 2 == 0) {
x *= x; x %= MOD; n /= 2;
} else {
y *= x; x *= x; x %= MOD; n = (n - 1) / 2;
}
}
return (x * y) % MOD;
}
int main() {
int N, P; fin >> N >> P;
fout << pow(N, P) << endl;
}