Pagini recente » Cod sursa (job #1060212) | Cod sursa (job #2758890) | Cod sursa (job #2564766) | Cod sursa (job #1567527) | Cod sursa (job #1241135)
#include <stdio.h>
#define mod 1999999973
using namespace std;
long long exp(long long x, long long p)
{
if(!p)return 1;
if(p%2==0)return (exp(x*x,p/2)%mod)%mod;
if(p%2!=0)return (x%mod)*(exp(x*x,p/2)%mod)%mod;
}
int main()
{
long long n,p;
FILE *f1=fopen("lgput.in","r"),*f2=fopen("lgput.out","w");
fscanf(f1,"%lld%lld",&n,&p);
fprintf(f2,"%lld",exp(n,p));
return 0;
}
//Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.