Modular Exponentiation 2 by inaniwa

b,e,m;main(r){for(;~scanf("%d%d%d",&b,&e,&m);printf("%d\n",r))for(r=1;e&1?r=1ll*r*b%m:0,b=1ll*b*b%m,e/=2;);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page