by@qcfium
WA
1174ms
#include <stdio.h> int main() { for (int i = 0; i < 30; i++) { char s[11]; gets(s); bool prev = true; int res = 0; for (int j = 0; j < 10; j++) { bool cur = s[j] == '|'; if (!prev && !cur) break; res += cur; prev = cur; } printf("%d\n", res); } return 0; }
|_||__||_| |||_|____| |__||_|_|_ ||||||_||| |||__||__| |___|__||_ |||_||_|__ ||||___|_| ||___||__| ||__|__|_| |_|||_|__| ||||||||__ |_____|___ ||________ |_||_||__| |||_|_|___ |||_|_____ |||||||_|_ |____|__|| ||||_|__|_ ||_|||||__ |_|_||_||_ |_|_|___|| |_|_||||_| |||__|_|_| |_______|_ ||_|_||_|| ||_____||| |_|||_|_|_ |____|_||_
/tmp/code.cpp:6:3: error: use of undeclared identifier 'gets' gets(s); ^ 1 error generated. /root/script: 7: /root/script: /tmp/code: not found rm: cannot remove '/tmp/code': No such file or directory
10 execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffc105ebd50 /* 6 vars */) = 0 11 execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x5638b941fc00 /* 6 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.cpp"], 0x5638b941fc20 /* 6 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/clang-9", ["/usr/bin/clang-9", "-Wall", "-O2", "-std=c++2a", "/tmp/code.cpp", "-o", "/tmp/code", "-lm", "-lstdc++"], 0x5638ba314658 /* 6 vars */) = 0 14 execve("/usr/lib/llvm-9/bin/clang", ["/usr/lib/llvm-9/bin/clang", "-cc1", "-triple", "x86_64-pc-linux-gnu", "-emit-obj", "-disable-free", "-disable-llvm-verifier", "-discard-value-names", "-main-file-name", "code.cpp", "-mrelocation-model", "static", "-mthread-model", "posix", "-fmath-errno", "-masm-verbose", "-mconstructor-aliases", "-munwind-tables", "-fuse-init-array", "-target-cpu", "x86-64", "-dwarf-column-info", "-debugger-tuning=gdb", "-momit-leaf-frame-pointer", "-resource-dir", "/usr/lib/llvm-9/lib/clang/9.0.0", "-internal-isystem", "/usr/bin/../lib/gcc/x86_64-linux"..., "-internal-isystem", "/usr/bin/../lib/gcc/x86_64-linux"..., "-internal-isystem", "/usr/bin/../lib/gcc/x86_64-linux"..., ...], 0x7ffd168e6bb8 /* 6 vars */) = 0 14 +++ exited with 1 +++ 13 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14, si_uid=0, si_status=1, si_utime=2, si_stime=2} --- 13 +++ exited with 1 +++ 10 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=1, si_utime=0, si_stime=4} --- 16 execve("/tmp/code", ["/tmp/code"], 0x5638b941fbd0 /* 6 vars */) = -1 ENOENT (No such file or directory) 16 +++ exited with 127 +++ 10 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=127, si_utime=0, si_stime=0} --- 15 execve("/bin/cat", ["cat", "-"], 0x5638b941fbe8 /* 6 vars */) = 0 15 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=15, si_uid=0} --- 15 +++ killed by SIGPIPE +++ 10 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=15, si_uid=0, si_status=SIGPIPE, si_utime=0, si_stime=0} --- 17 execve("/bin/rm", ["rm", "/tmp/code.cpp", "/tmp/code"], 0x5638b941fbd0 /* 6 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 +++