Modular Exponentiation by 51b

void main(){int n=1000,t=n;int[1000]p,q,r;for(*r=2;n%10<1?p=r,q[]*=0,*q=1:0,n--;q=r)for(int i,x,j;i<t;r[i++]=x%10,x/=10)for(j=i;~j;)x+=p[j]*q[i-j--];for(n=t;n--;)printf("%d",p[n]);}

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

download

return to the top page