七行プログラミング

このエントリーをはてなブックマークに追加
>>744 なるほどぉ出来ました

#include <iostream>
unsigned W,O,u=256,i,l,K,b,a[256],R=~0,y=1<<24,x=u;main(int,char**V){unsigned
char t[y];if(*V[1]-69){cin>>O;cin.read(t,6);for(W=t[2]*y|t[3]<<16|t[4]*x|t[5];l
<O;R*=a[b]){for(K=b=0;R<y;R*=x)W=W*x|cin.get();for(R/=u++;W/R>=K;K+=a[b++]+1);W
-=R*(K-++a[t[l++]=--b]);}}else{for(;~(i=cin.get());K=W,l++){for(b=0;b<i;W+=R/u*
(a[b++]+1));if(K>W)for(K=O;!++t[--K];);for(R=R/u++*++a[i];R<y;R*=x)t[O++]=W/y,W
*=x;}cout<<l<<-1;t[O++]=W/y;t[O++]=W>>16;t[O++]=W/x;t[O++]=W;}cout.write(t,O);}

ってことで7行です。
ロジックを縮めまくったcompさんに拍手