Pagini recente » Borderou de evaluare (job #1270014) | Rezultatele filtrării | Istoria paginii utilizator/libero | Diferente pentru problema/sate intre reviziile 22 si 10 | Cod sursa (job #2257253)
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
int power(int x, int y) {
if (y == 0) {
return 1;
}
int r = power(x, y / 2);
cout << r << ' ';
if (y % 2 == 0) {
return (1LL * r * r) % MOD;
} else {
return (1LL * x * r * r) % MOD;
}
}
int main() {
int N, P;
fin >> N >> P;
fout << power(N, P);
}