Pagini recente » Cod sursa (job #3039180) | Cod sursa (job #259800) | Cod sursa (job #2127538) | Cod sursa (job #281957) | Cod sursa (job #1392575)
#include <iostream>
#include <fstream>
#define MOD 1999999973
#define LL long long
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
LL n,p;
void read(){
f>>n>>p;
}
LL lgput(LL nr,LL p){
if(p == 0)
return 1;
if(p == 1)
return nr;
if(p%2 == 0){
LL tmp = lgput(nr,p/2);
return (tmp*tmp)%MOD;
}
return (nr*lgput(nr,p-1))%MOD;
}
void solve(){
g<<lgput(n,p);
}
int main()
{
read();
solve();
return 0;
}