Pagini recente » Profil free2infiltrate | Cod sursa (job #506419) | Cod sursa (job #3200426) | Cod sursa (job #155658) | Cod sursa (job #1983787)
#include <iostream>
using namespace std;
const int MOD = 1999999973;
void Multiply(int& a, int b) {
a = int64_t(a) * b % MOD;
}
int Pow(int a, int b) {
int ans = 1;
while (b > 0) {
if (b & 1)
Multiply(ans, a);
b >>= 1;
Multiply(a, a);
}
return ans;
}
int main() {
int N, P;
ifstream("lgput.in") >> N >> P;
ofstream("lgput.out") << Pow(N, P) << "\n";
return 0;
}