Pagini recente » Cod sursa (job #1324022) | Cod sursa (job #1910459) | Diferente pentru problema/fft intre reviziile 1 si 2 | Profil Tatomir Alex - atatomir | Cod sursa (job #2633871)
#include <fstream>
using namespace std;
ifstream cin("lgput.in");
ofstream cout("lgput.out");
const int MOD=2e9-27;
int pow(int N, int P) {
if(P==0)
return 1;
if(P&1) {
return (1LL*N*pow((1LL*N*N)%MOD, P/2))%MOD;
}
return pow((1LL*N*N)%MOD, P/2);
}
int main() {
int N, P;
cin>>N>>P;
cout<<pow(N, P)<<'\n';
return 0;
}