Pagini recente » Cod sursa (job #1648445) | Cod sursa (job #3157066) | Cod sursa (job #2045012) | Cod sursa (job #1650966) | Cod sursa (job #3257924)
#include <stdio.h>
#define p 1999999973;
int main(){
int b, ans, pow;
long long ans0;
FILE *fin, *fout;
fin = fopen( "lgput.in", "r" );
fscanf( fin, "%d%d", &b, &pow );
fclose( fin );
ans = 1;
ans0 = 1;
while ( pow > 0 ) {
if ( pow % 2 == 1 )
ans0 = (ans0 * b) % p;
ans = ans0;
pow = pow / 2;
b = b * b;
}
fout = fopen( "lgput.out", "w" );
fprintf( fout, "%d\n", ans );
fclose( fout );
return 0;
}