Pagini recente » Cod sursa (job #868151) | Cod sursa (job #559066) | Cod sursa (job #1199831) | Cod sursa (job #157223) | Cod sursa (job #1740530)
#include<stdio.h>
using namespace std;
FILE *f1=fopen("lgput.in","r");
FILE *f2=fopen("lgput.out","w");
int n,p;
int putere(int a,int b){
long long val;
if (b==0) return 1;
if (b%2==0){
val=putere(a,b/2)%1999999973;
return (val*val)%1999999973;
}
val=putere(a,b-1)%1999999973;
return (a*putere(a,b-1))%1999999973;
}
int main(){
fscanf(f1,"%d%d",&n,&p);
fclose(f1);
fprintf(f2,"%d",putere(n,p));
fclose(f2);
return 0;
}