Adjusted alternate version to preserve formatting
The first alt version added some whitespaces that broke the outline, so I simply filled those up. I also expanded tabs to spaces since there is no size limit restriction for the alternate version. The second alt version attempted to force binary mode with _setmode() and _fileno() calls, plus some additional headers. Rather than doing it this way, I hack in the binary mode adjustments via preprocessor. Actually I did a similar trick for IOCCC 2011, but I guess I didn't submit that version: https://uguu.org/archive/ioccc2011/akari/source/binmode_main.h The file above uses _setmode() and _fileno(). The leading underscore indicates that they were nonstandard extensions. For the binmode_main.h in this change, I have opted for setmode() and STDIN_FILENO instead, which are more widely available.
This commit is contained in:
1 parent
376f51c489
commit
aff78be8f9
5 files changed
+93
-117
No files matched your search
@@ -1,44 +1,44 @@
|
||||
#include<stdio.h>
|
||||
typedef unsigned int _;_ d,b,
|
||||
#define i(I1,Il,lI)if(Il){lI;}else{I1;}
|
||||
I[256], n,y,a,r,u,k,o
|
||||
,L,l[ 256],O,K[
|
||||
/**/ #define\
|
||||
q(g) g char\
|
||||
*C, *Q,c[\
|
||||
]= "KfW"\
|
||||
"" "Ww|"\
|
||||
/* 'UU!\
|
||||
% NYA!\
|
||||
*/ "Z}"\
|
||||
";fRo?JtJaV<x4@*?R?&JV1" ".s"\
|
||||
"{Fyj2_;khB1xQ5oxm~mS@B|(pa>oRU" "Ro"\
|
||||
"nB}h@o?)d.X)NSTIUCz7@%",*s[]={c,"#en" "di"\
|
||||
"f/*}||1;\n__DATA__\40*/\n\n#ifndef\40q\n#d" "ef"\
|
||||
"ine\x20q\n#include<stdio.h>\ntypedef\40unsign" "e"\
|
||||
"d\x20int\x20_;_\x20K[]={\n#include\40__FILE__\n#u" "n"\
|
||||
"def q","0},L,O,l[256],I[256],n,y,a,r,u,k,o;"#g"char" "*"\
|
||||
"S,s[]=\"",c,c,"\";int main(){X();for(S=s+*K;*S>37;){for" "(o"\
|
||||
"=0;o<5;o++)r=r*85+(83+*S++)%89;r","^=*x();for(o=0;o<4;o++" ")"\
|
||||
"{s[O++]=r&255;r>>=8;}}return!fwrite(s,O-*S%5,1,stdout);}\n" "#"\
|
||||
"endif",c},S[256]="#ifdef/*\n'true'\40or\40q{\nexec\40head\40" "-"\
|
||||
"8\40$0\n};for(open$O,$0;<$O>;print\40if$f){$f|=/^$/;}q{*/q",/* */z;
|
||||
256];q(_*x(){if(!L--){y+=++a;for(o=0;o<256;y=l[o++]=I[255&(k>>10 )]+u
|
||||
){n^=(o&1)?n>>(( o& 2)?16:6):n<<((o&2)?2:13);u=I[o];k=I[o]=I[255& (u>>
|
||||
2)]+(n+=I[(o+128) & 255]) +y;}L=255;}return&l[L];}_*X(){for(O=0 ;256
|
||||
>O;I[O++]=0);for(O = 0; sizeof(K)/sizeof( _)> O;O++)I[O&255] ^=K[
|
||||
O];for(n=y=a=L=O=0 ;O<1<<24;++ O)x( );r=O=0x0; return&O;})int/*^^*/ main
|
||||
(int p,char**P){FILE* Z=fopen(p> (+ 1)?P[01 ] :P[0], "rb"
|
||||
);i(;,Z,O=fread(K,256 ,4,Z);/*P */ fclose(Z))X();for(p=b=d =O=
|
||||
0;O<256;K[O++]=0)*K=+ 86;for(O =1;12> O;K[O++]=*x());X(); for
|
||||
(C=Q=S;r-8;){i(*C++=34, (r-4&&r -5)||C- S ,;)z=Q[p++];i(;,z !=
|
||||
32||r-3,i(i(C+=sprintf(( C), "%uU" ",",K[b++]);i(d=1;C =S
|
||||
;i(d=02,b-12,;),b%6,;),r-1 ,i(b= fread(c,1,4,stdin);i (p
|
||||
=O=0,b,for(d=O=0;O<04;O++)d +=(c[O]&255)<<(8*O);d ^=
|
||||
*x();for(p=5;p;c[--p]=O<32?O+ 95:O+6){O=d%85;d/=85;} O=
|
||||
5)i(d=0,b<4,c[O++]=b?b-1?b-2?36: 37:33:35 ;d=2)c[O]=0,r-4,i(i (d= 2
|
||||
|d,C!=S+6,*C++=(*x()%34)+93;p--),r -5,*s= C;d|=2) )),z ,i(*C++ =92 ,
|
||||
z-63||C [-1]-63||C>S+76,;)*C++=z))i( ;,d>1,d= d-2 ;Q=s[r] ;i( ;
|
||||
I[256], n,y,a,r,u,k,o
|
||||
,L,l[ 256],O,K[
|
||||
/**/ #define\
|
||||
q(g) g char\
|
||||
*C, *Q,c[\
|
||||
]= "KfW"\
|
||||
"" "Ww|"\
|
||||
/* 'UU!\
|
||||
% NYA!\
|
||||
*/ "Z}"\
|
||||
";fRo?JtJaV<x4@*?R?&JV1" ".s"\
|
||||
"{Fyj2_;khB1xQ5oxm~mS@B|(pa>oRU" "Ro"\
|
||||
"nB}h@o?)d.X)NSTIUCz7@%",*s[]={c,"#en" "di"\
|
||||
"f/*}||1;\n__DATA__\40*/\n\n#ifndef\40q\n#d" "ef"\
|
||||
"ine\x20q\n#include<stdio.h>\ntypedef\40unsign" "e"\
|
||||
"d\x20int\x20_;_\x20K[]={\n#include\40__FILE__\n#u" "n"\
|
||||
"def q","0},L,O,l[256],I[256],n,y,a,r,u,k,o;"#g"char" "*"\
|
||||
"S,s[]=\"",c,c,"\";int main(){X();for(S=s+*K;*S>37;){for" "(o"\
|
||||
"=0;o<5;o++)r=r*85+(83+*S++)%89;r","^=*x();for(o=0;o<4;o++" ")"\
|
||||
"{s[O++]=r&255;r>>=8;}}return!fwrite(s,O-*S%5,1,stdout);}\n" "#"\
|
||||
"endif",c},S[256]="#ifdef/*\n'true'\40or\40q{\nexec\40head\40" "-"\
|
||||
"8\40$0\n};for(open$O,$0;<$O>;print\40if$f){$f|=/^$/;}q{*/q",/* */z;
|
||||
256];q(_*x(){if(!L--){y+=++a;for(o=0;o<256;y=l[o++]=I[255&(k>>10 )]+u
|
||||
){n^=(o&1)?n>>(( o& 2)?16:6):n<<((o&2)?2:13);u=I[o];k=I[o]=I[255& (u>>
|
||||
2)]+(n+=I[(o+128) & 255]) +y;}L=255;}return&l[L];}_*X(){for(O=0 ;256
|
||||
>O;I[O++]=0);for(O = 0; sizeof(K)/sizeof( _)> O;O++)I[O&255] ^=K[
|
||||
O];for(n=y=a=L=O=0 ;O<1<<24;++ O)x( );r=O=0x0; return&O;})int/*^^*/ main
|
||||
(int p,char**P){FILE* Z=fopen(p> (+ 1)?P[01 ] :/*proc/self*/*P, "rb"
|
||||
);i(;,Z,O=fread(K,256 ,4,Z);/*P */ fclose(Z))X();for(p=b=d =O=
|
||||
0;O<256;K[O++]=0)*K=+ 86;for(O =1;12> O;K[O++]=*x());X(); for
|
||||
(C=Q=S;r-8;){i(*C++=34, (r-4&&r -5)||C- S ,;)z=Q[p++];i(;,z !=
|
||||
32||r-3,i(i(C+=sprintf(( C), "%uU" ",",K[b++]);i(d=1;C =S
|
||||
;i(d=02,b-12,;),b%6,;),r-1 ,i(b= fread(c,1,4,stdin);i (p
|
||||
=O=0,b,for(d=O=0;O<04;O++)d +=(c[O]&255)<<(8*O);d ^=
|
||||
*x();for(p=5;p;c[--p]=O<32?O+ 95:O+6){O=d%85;d/=85;} O=
|
||||
5)i(d=0,b<4,c[O++]=b?b-1?b-2?36: 37:33:35 ;d=2)c[O]=0,r-4,i(i (d= 2
|
||||
|d,C!=S+6,*C++=(*x()%34)+93;p--),r -5,*s= C;d|=2) )),z ,i(*C++ =92 ,
|
||||
z-63||C [-1]-63||C>S+76,;)*C++=z))i( ;,d>1,d= d-2 ;Q=s[r] ;i( ;
|
||||
,r<3|| r>5,d=1;i(;,r-1, *C=0)C=S) i(;, r-4, p=0)++ r) i(*(C++ )=
|
||||
34,r <4||r>5|| C<S+ 78,;)i (*C++=0;d=1; C=S ,r<3 || r>
|
||||
5 ||C<S+ 79,; )i(;,d, puts (
|
||||
|
||||
Reference in new issue
Block a user