Pagini recente » Borderou de evaluare (job #3198628) | Borderou de evaluare (job #2175447) | Istoria paginii problema/rafturi | Castel3 | Cod sursa (job #2711969)
#include <iostream>
#include <fstream>
using namespace std;
const int mod = 1999999973;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int lgput(int x, int y) {
int rez = 1;
int exp = x;
while (y) {
if (y & 1)
rez = 1LL * rez * exp, rez %= mod;
exp = 1LL * exp * exp;
exp %= mod;
y >>= 1;
}
return rez;
}
int main() {
int x, y;
cin>>x>>y;
cout<<lgput(x, y);
}