Pagini recente » Cod sursa (job #2498124) | Statistici Muscalu Alexandru (musk) | Cod sursa (job #1019908) | Cod sursa (job #2929981) | Cod sursa (job #2931639)
#include <bits/stdc++.h>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
const int modulo = 1999999973;
using ll = long long;
ll lgput(ll x, ll putere)
{
ll rez = 1;
while(putere)
{
if(putere%2 == 1) rez*=x;
putere/=2;
(x*=x)%=modulo;
}
return rez%modulo;
}
int main()
{
ll n,p; in>>n>>p;
out<<lgput(n,p);
return 0;
}