Modular Exponentiation by 51b

a[8<<18];*p,*q,*r=a;t=1e3;n;main(i,j,x){for(*r=2;n%10<1?p=r,q=p+t,*q=1:1,n++<t;q=r)for(i=x=0,r=q+t;i<t;r[i++]=x%10,x/=10)for(j=i;~j;)x+=p[j]*q[i-j--];for(n=t;n--;)putchar(p[n]+48);}

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

download

return to the top page