Pagini recente » Clasament 6d_seb_sapatamanaaltfel | Cod sursa (job #1668087) | Cod sursa (job #2910050) | Cod sursa (job #206574) | Cod sursa (job #632938)
Cod sursa(job #632938)
#include <iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
#define modulo 1999999973
int f(int N, int P)
{
if(P==0) return 1;
long long x = f(N,P/2) ;
if(P%2==1) return (x * x) % modulo * N % modulo;
else return (x * x) % modulo;
}
int main()
{ int P;
int N;
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
cin>>N>>P;
cout<<f(N,P);
}