by@n4o847
WA
2132ms
import os fn main(){for{a:=os.get_line() println(a[if a[1]==a[2]{2}else{4}])}}
224 353 715 552 388 871 937 788 644 768 787 786 796 448 898 611 466 167 355 451 849 895 966 291 643 439 276 773 787 988 454 546 811 119 822 221 861 682 891 195 837 235 322 557 966 887 184 887 532 228 312 276 477 735 397 478 713 199 684 168 959 447 946 592
3 5 8 7 4 7 4 6 6 5 8 6 4 7 9 5 1 2 6 1 2 2 6 8 2 2 7 4 1 1 4 5 V panic: string index out of range: 1 / 0 backtrace_symbols_fd is missing, so printing backtraces is not available. Some libc implementations like musl simply do not provide it.
10 execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffc9ecae630 /* 7 vars */) = 0 11 execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x55e13bccad18 /* 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/cp", ["cp", "-f", "/volume/CODE", "/tmp/code.v"], 0x55e13bccad38 /* 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("/bin/cat", ["cat", "-"], 0x55e13bccad58 /* 7 vars */ <unfinished ...> 14 execve("/root/v", ["/root/v", "run", "/tmp/code.v"], 0x55e13bccad80 /* 7 vars */ <unfinished ...> 13 <... execve resumed>) = 0 14 <... execve resumed>) = 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} --- 15 execve("/bin/sh", ["sh", "-c", "cc -std=gnu11 -Wall -Wextra -Wn"...], 0x559f0aae4780 /* 8 vars */) = 0 15 execve("/usr/bin/cc", ["cc", "-std=gnu11", "-Wall", "-Wextra", "-Wno-unused-variable", "-Wno-unused-parameter", "-Wno-unused-result", "-Wno-unused-function", "-Wno-missing-braces", "-Wno-unused-label", "-Werror=implicit-function-declar"..., "-o", "/tmp/code", "/root/.cache/v/code.tmp.c", "-lm", "-lpthread", "-ldl"], 0x55aa02dd9688 /* 8 vars */) = 0 16 execve("/usr/libexec/gcc/x86_64-alpine-linux-musl/9.3.0/cc1", ["/usr/libexec/gcc/x86_64-alpine-l"..., "-quiet", "/root/.cache/v/code.tmp.c", "-quiet", "-dumpbase", "code.tmp.c", "-mtune=generic", "-march=x86-64", "-auxbase", "code.tmp", "-Wall", "-Wextra", "-Wno-unused-variable", "-Wno-unused-parameter", "-Wno-unused-result", "-Wno-unused-function", "-Wno-missing-braces", "-Wno-unused-label", "-Werror=implicit-function-declar"..., "-std=gnu11", "-o", "/tmp/ccOdkIbh.s"], 0x53dc20 /* 11 vars */) = 0 16 +++ exited with 0 +++ 15 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=0, si_utime=73, si_stime=3} --- 17 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/ccFeHoBI.o", "/tmp/ccOdkIbh.s"], 0x53dc20 /* 11 vars */) = 0 17 +++ exited with 0 +++ 15 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=0, si_utime=7, si_stime=1} --- 18 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", ...], 0x53dc20 /* 13 vars */) = 0 19 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", ...], 0x7ffe3f8ef9c0 /* 13 vars */) = 0 19 +++ exited with 0 +++ 18 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- 18 +++ exited with 0 +++ 15 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=18, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- 15 +++ exited with 0 +++ 14 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=15, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- 20 execve("/bin/sh", ["sh", "-c", "\"/tmp/code\""], 0x559f0aae4780 /* 8 vars */) = 0 20 execve("/tmp/code", ["/tmp/code"], 0x557c8e69ec60 /* 8 vars */) = 0 20 +++ exited with 1 +++ 14 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=20, si_uid=0, si_status=1, si_utime=0, si_stime=0} --- 14 +++ exited with 1 +++ 10 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14, si_uid=0, si_status=1, si_utime=6, si_stime=4} --- 10 +++ exited with 1 +++