七行プログラミング part2
at TECH
923:デフォルトの名無しさん
02/09/26 23:33
>>922
#include <iostream>
unsigned W,O,u=256,i=6,l,K,b,a[256],R=~0,y=1<<24,x=u;main(int,char**V){unsigned
char*t=new unsigned char[1<<24];if(*V[1]-69){for(cin>>O;i--;)W=W*x|cin.get();
for(;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;for(y=4;y--;)t[O++]=W>>y*8;}cout.write(t,O);}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5382日前に更新/349 KB
担当:undef