Result

WA

Duration

1197ms

Code [DL]

main(char*s){for(;gets(s);)putchar(s[s[1]-s[2]?4:1]);}

stdin

669 445
433 115
342 448
299 991
374 432
184 447
284 481
877 767
635 739
133 994
277 799
745 551
274 119
326 537
311 119
177 373
758 455
934 141
265 659
139 332
159 517
336 457
977 678
475 746
769 966
637 769
827 736
126 142
386 869
263 534
633 482
722 848

stdout

stderr

/tmp/code.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
    1 | main(char*s){for(;gets(s);)putchar(s[s[1]-s[2]?4:1]);}
      | ^~~~
/tmp/code.c:1:1: warning: first argument of 'main' should be 'int' [-Wmain]
/tmp/code.c:1:1: warning: 'main' takes only zero or two arguments [-Wmain]
/tmp/code.c: In function 'main':
/tmp/code.c:1:19: warning: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | main(char*s){for(;gets(s);)putchar(s[s[1]-s[2]?4:1]);}
      |                   ^~~~
/tmp/code.c:1:28: warning: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
    1 | main(char*s){for(;gets(s);)putchar(s[s[1]-s[2]?4:1]);}
      |                            ^~~~~~~
Segmentation fault (core dumped)

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE.c"], 0x7ffcf8de97d0 /* 7 vars */) = 0
11    execve("/usr/bin/realpath", ["realpath", "/volume/CODE.c"], 0x560b6e2bbd20 /* 7 vars */) = 0
11    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
12    execve("/bin/ln", ["ln", "-sf", "/volume/CODE.c", "/tmp/code.c"], 0x560b6e2bbd40 /* 7 vars */) = 0
12    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
13    execve("/usr/bin/gcc", ["gcc", "-Wall", "-O2", "-std=c99", "/tmp/code.c", "-o", "/tmp/code", "-lm"], 0x560b6f5ab0d8 /* 7 vars */) = 0
14    execve("/usr/libexec/gcc/x86_64-alpine-linux-musl/9.3.0/cc1", ["/usr/libexec/gcc/x86_64-alpine-l"..., "-quiet", "/tmp/code.c", "-quiet", "-dumpbase", "code.c", "-mtune=generic", "-march=x86-64", "-auxbase", "code", "-O2", "-Wall", "-std=c99", "-o", "/tmp/ccNmcpeJ.s"], 0x1b3e020 /* 10 vars */) = 0
14    +++ exited with 0 +++
13    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14, si_uid=0, si_status=0, si_utime=1, si_stime=1} ---
15    execve("/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/as", ["/usr/lib/gcc/x86_64-alpine-linux"..., "--64", "-o", "/tmp/ccHOKdpk.o", "/tmp/ccNmcpeJ.s"], 0x1b3e020 /* 10 vars */) = 0
15    +++ exited with 0 +++
13    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=15, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
16    execve("/usr/libexec/gcc/x86_64-alpine-linux-musl/9.3.0/collect2", ["/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin", "/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", "--as-needed", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "-pie", "-z", "relro", "-z", "now", "-o", "/tmp/code", "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/lib/../lib", "-L/usr/lib/../lib", ...], 0x1b3e020 /* 12 vars */) = 0
17    execve("/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld", ["/usr/lib/gcc/x86_64-alpine-linux"..., "-plugin", "/usr/libexec/gcc/x86_64-alpine-l"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lgcc_"..., "--eh-frame-hdr", "--hash-style=gnu", "-m", "elf_x86_64", "--as-needed", "-dynamic-linker", "/lib/ld-musl-x86_64.so.1", "-pie", "-z", "relro", "-z", "now", "-o", "/tmp/code", "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "/usr/lib/gcc/x86_64-alpine-linux"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/lib/../lib", "-L/usr/lib/../lib", ...], 0x7fffdd327ee0 /* 12 vars */) = 0
17    +++ exited with 0 +++
16    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=0, si_utime=0, si_stime=1} ---
16    +++ exited with 0 +++
13    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
13    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
18    execve("/bin/cat", ["cat", "-"], 0x560b6e2bbd08 /* 7 vars */ <unfinished ...>
19    execve("/tmp/code", ["/tmp/code"], 0x560b6e2bbcf0 /* 7 vars */ <unfinished ...>
18    <... execve resumed>)             = 0
19    <... execve resumed>)             = 0
19    --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1} ---
18    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=18, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
19    +++ killed by SIGSEGV (core dumped) +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_DUMPED, si_pid=19, si_uid=0, si_status=SIGSEGV, si_utime=0, si_stime=0} ---
20    execve("/bin/rm", ["rm", "/tmp/code.c", "/tmp/code"], 0x560b6e2bbcf0 /* 7 vars */) = 0
20    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=20, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
10    +++ exited with 0 +++