Result

WA

Duration

910ms

Code [DL]

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

stdin

861 911
198 682
987 719
157 579
579 876
566 663
378 443
884 844
631 479
295 195
747 732
492 292
366 364
277 255
418 887
962 779
477 772
961 112
455 883
944 114
599 964
624 226
971 724
511 813
944 413
191 958
152 187
122 146
445 541
584 885
837 496
673 727

stdout

stderr

error: mismatched closing delimiter: `)`
 --> /tmp/code.rs:1:122
  |
1 | use std::io::*;fn main(){let mut a=[0;8];while stdin().read(&mut a).unwrap()==8{print!("{}",a[if(a[2]!=a[1]){4}else{1}-48);}}
  |                                                                                       -      -                           ^ mismatched closing delimiter
  |                                                                                       |      |
  |                                                                                       |      unclosed delimiter
  |                                                                                       closing delimiter possibly meant for this

warning: unnecessary parentheses around `if` condition
 --> /tmp/code.rs:1:97
  |
1 | use std::io::*;fn main(){let mut a=[0;8];while stdin().read(&mut a).unwrap()==8{print!("{}",a[if(a[2]!=a[1]){4}else{1}-48);}}
  |                                                                                                 ^^^^^^^^^^^^ help: remove these parentheses
  |
  = note: `#[warn(unused_parens)]` on by default

error: aborting due to previous error

/root/script: line 7: /tmp/code: not found
rm: can't remove '/tmp/code': No such file or directory

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffdec95d970 /* 7 vars */) = 0
11    execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x55fc391a1d18 /* 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"], 0x55fc391a1d38 /* 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"], 0x55fc391a1d48 /* 7 vars */) = 0
14    +++ exited with 0 +++
13    +++ exited with 1 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=1, si_utime=4, si_stime=3} ---
15    execve("/bin/cat", ["cat", "-"], 0x55fc391a1d08 /* 7 vars */) = 0
16    execve("/tmp/code", ["/tmp/code"], 0x55fc391a1cf0 /* 7 vars */) = -1 ENOENT (No such file or directory)
16    +++ exited with 127 +++
15    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=127, si_utime=0, si_stime=0} ---
17    execve("/bin/rm", ["rm", "/tmp/code.rs", "/tmp/code"], 0x55fc391a1cf0 /* 7 vars */) = 0
17    +++ exited with 1 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=1, si_utime=0, si_stime=0} ---
10    +++ exited with 1 +++