Pagini recente » Cod sursa (job #1030544) | Cod sursa (job #2285943) | Cod sursa (job #555747) | Cod sursa (job #218545) | Cod sursa (job #2689764)
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll powlg(ll x, ll b, ll mod) {
if(b < 0) return powlg(1 / x, -b, mod);
if(b == 0) return 1;
if(b == 1) return x;
if(b%2 == 0) return powlg(x * x, b>>1, mod) % mod;
if(b%2 == 1) return (x * powlg(x * x, (b-1)>>1, mod)) % mod;
return 0;
}
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main(){
ll x,y;
fin>>x>>y;
fout<<powlg(x, y, 1999999973) % 1999999973;
}