Modular Exponentiation 2 by tanakh

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

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

download

return to the top page