Pagini recente » Cod sursa (job #2016278) | Profil Alexxxx | **** | Autentificare | Cod sursa (job #763485)
Cod sursa(job #763485)
#include <cstdio>
#include <algorithm>
using namespace std;
#define MOD 1999999973
typedef long long ll;
ll n;
ll pow(ll p){
if(p == 1)return n; else
{
ll z = pow(p/2);
if(p%2)return z*z%MOD*n%MOD; else
return z*z%MOD;
}
}
int main(){
long long p;
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld %lld",&n,&p);
printf("%lld\n",pow(p));
return 0;
}