Pagini recente » Profil NekroDana | Rating Barbulescu Robert-Cristian (Robert2407) | Cod sursa (job #2126154) | Cod sursa (job #937492) | Cod sursa (job #3257927)
#include <stdio.h>
#define p 1999999973
int main(){
unsigned int b, ans, pow;
FILE *fin, *fout;
fin = fopen( "lgput.in", "r" );
fscanf( fin, "%u%u", &b, &pow );
fclose( fin );
ans = 1;
while ( pow > 0 ) {
if ( pow % 2 == 1 )
ans = (ans * b) % p;
pow = pow / 2;
b = (b * b) % p;
}
fout = fopen( "lgput.out", "w" );
fprintf( fout, "%u\n", ans );
fclose( fout );
return 0;
}