BWT by 7gyou

char t[99][99];strcmp(),v;main(l){for(;gets(t);){for(strncat(t,t,v=l=strlen(t));v;)strcpy(t+v--,*t+v);for(qsort(t,l,99,strcmp);bcmp(t+v,t+l,l);)v++;for(v=!printf("%d ",v);putchar(v-l?t[v++][l-1]:10)-10;);}}

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

download

return to the top page