Result

AC

Duration

1648ms

Code [DL]

use std::io::*;fn main(){loop{let b=&mut[0;8];stdin().read(b);print!("{}",b[if b[1]==b[2]{2}else{4}]-48)}}

stdin

948 882
712 172
295 995
621 216
186 322
946 879
822 229
954 443
833 348
644 665
344 541
853 383
534 835
987 992
765 561
922 225
784 213
396 939
215 451
822 869
422 731
387 331
174 412
613 535
188 992
988 985
989 889
388 821
827 726
546 163
235 939
168 681

stdout

81923824344389522942234588887196

stderr

warning: unused `std::result::Result` that must be used
 --> /tmp/code.rs:1:47
  |
1 | use std::io::*;fn main(){loop{let b=&mut[0;8];stdin().read(b);print!("{}",b[if b[1]==b[2]{2}else{4}]-48)}}
  |                                               ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_must_use)]` on by default
  = note: this `Result` may be an `Err` variant, which should be handled

thread 'main' panicked at 'attempt to subtract with overflow', /tmp/code.rs:1:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffdc46e4400 /* 7 vars */) = 0
11    execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x563150b79d18 /* 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", "/tmp/code.rs"], 0x563150b79d38 /* 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/rustc", ["/usr/bin/rustc", "-o", "/tmp/code", "/tmp/code.rs"], 0x563150b79d48 /* 7 vars */) = 0
17    +++ exited with 0 +++
18    +++ exited with 0 +++
19    +++ exited with 0 +++
20    +++ exited with 0 +++
22    +++ exited with 0 +++
23    +++ exited with 0 +++
21    +++ exited with 0 +++
26    +++ exited with 0 +++
32    +++ exited with 0 +++
24    +++ exited with 0 +++
25    +++ exited with 0 +++
27    +++ exited with 0 +++
30    +++ exited with 0 +++
28    +++ exited with 0 +++
29    +++ exited with 0 +++
33    +++ exited with 0 +++
15    --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_TKILL, si_pid=13, si_uid=0} ---
31    +++ exited with 0 +++
15    +++ exited with 0 +++
16    +++ exited with 0 +++
34    execve("/usr/lib/rustlib/x86_64-alpine-linux-musl/bin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = -1 ENOENT (No such file or directory)
34    execve("/bin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = -1 ENOENT (No such file or directory)
34    execve("/usr/local/sbin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = -1 ENOENT (No such file or directory)
34    execve("/usr/local/bin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = -1 ENOENT (No such file or directory)
34    execve("/usr/sbin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = -1 ENOENT (No such file or directory)
34    execve("/usr/bin/cc", ["cc", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-Wl,--eh-frame-hdr", "-m64", "-L", "/usr/lib/rustlib/x86_64-alpine-l"..., "/tmp/code.code.7rcbfp3g-cgu.0.rc"..., "/tmp/code.code.7rcbfp3g-cgu.1.rc"..., "/tmp/code.code.7rcbfp3g-cgu.10.r"..., "/tmp/code.code.7rcbfp3g-cgu.11.r"..., "/tmp/code.code.7rcbfp3g-cgu.12.r"..., "/tmp/code.code.7rcbfp3g-cgu.13.r"..., "/tmp/code.code.7rcbfp3g-cgu.14.r"..., "/tmp/code.code.7rcbfp3g-cgu.15.r"..., "/tmp/code.code.7rcbfp3g-cgu.2.rc"..., "/tmp/code.code.7rcbfp3g-cgu.3.rc"..., "/tmp/code.code.7rcbfp3g-cgu.4.rc"..., "/tmp/code.code.7rcbfp3g-cgu.5.rc"..., "/tmp/code.code.7rcbfp3g-cgu.6.rc"..., "/tmp/code.code.7rcbfp3g-cgu.7.rc"..., "/tmp/code.code.7rcbfp3g-cgu.8.rc"..., "/tmp/code.code.7rcbfp3g-cgu.9.rc"..., "-o", "/tmp/code", "/tmp/code.14qnxy4t7ap9bmcs.rcgu."..., "-Wl,--gc-sections", "-pie", "-Wl,-zrelro", "-Wl,-znow", "-nodefaultlibs", "-L", ...], 0x55fcc2904160 /* 7 vars */) = 0
35    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"..., "--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/rustlib/x86_64-alpine"..., "-L/usr/lib/rustlib/x86_64-alpine"..., "-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", "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "--as-needed", ...], 0x18f02e0 /* 12 vars */) = 0
36    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"..., "--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/rustlib/x86_64-alpine"..., "-L/usr/lib/rustlib/x86_64-alpine"..., "-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", "-L/usr/lib/gcc/x86_64-alpine-lin"..., "-L/usr/lib/gcc/x86_64-alpine-lin"..., "--as-needed", ...], 0x7ffdb0e83038 /* 12 vars */) = 0
36    +++ exited with 0 +++
35    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=36, si_uid=0, si_status=0, si_utime=9, si_stime=14} ---
35    +++ exited with 0 +++
34    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=35, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
34    +++ exited with 0 +++
13    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=34, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
14    +++ exited with 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=13, si_stime=4} ---
37    execve("/bin/cat", ["cat", "-"], 0x563150b79d08 /* 7 vars */) = 0
38    execve("/tmp/code", ["/tmp/code"], 0x563150b79cf0 /* 7 vars */) = 0
37    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=37, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
38    +++ exited with 101 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=38, si_uid=0, si_status=101, si_utime=0, si_stime=0} ---
39    execve("/bin/rm", ["rm", "/tmp/code.rs", "/tmp/code"], 0x563150b79cf0 /* 7 vars */) = 0
39    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=39, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
10    +++ exited with 0 +++