Modular Exponentiation by flagitious

#define f(x)for(x=-1;x++<999;)
a[1999],b[1999],c[1999],j,m;main(i){b[0]=a[0]=2;f(i){f(j)f(m)c[m+j]+=a[j]*b[m];f(j)a[j]=c[j]%10,c[j+1]+=c[j]/10,i%9&8?b[j]=a[j]:i-901?:putchar(48+b[m+~j]),c[j]=0;}}

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

download

return to the top page