Result

AC

Duration

1123ms

Code [DL]

#include <stdio.h>

int main() {
	for (int i = 0; i < 30; i++) {
		char s[11];
		scanf("%s", 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;
}

stdin

|_||||____
||__||||||
|||||||_|_
|||||_||_|
|_|_|_|_||
||_____|||
||_|_|__||
|||__||_|_
|_____||__
|||__|___|
||__|||__|
|__|||__|_
|_|___||__
|_||____||
|_||_||_||
||||_||__|
||||___|__
||______|_
||||__||__
|_||_|||__
|__|___|__
|||_|__||_
|____|___|
||_|||____
|_|||_|__|
|||____||_
||__||__|_
|||___|_|_
|___||_|||
|_||||_|||

stdout

5
2
8
8
6
2
4
3
1
3
2
1
2
3
7
6
4
2
4
6
1
4
1
5
5
3
2
3
1
8

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffd8f9ea4a0 /* 6 vars */) = 0
11    execve("/usr/bin/realpath", ["realpath", "/volume/CODE"], 0x5639ffe1fc00 /* 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"], 0x5639ffe1fc20 /* 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++"], 0x563a001c8658 /* 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"..., ...], 0x7ffc24f4aa18 /* 6 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=3, si_stime=4} ---
15    execve("/usr/bin/ld", ["/usr/bin/ld", "-z", "relro", "--hash-style=gnu", "--build-id", "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "-o", "/tmp/code", "/usr/bin/../lib/gcc/x86_64-linux"..., "/usr/bin/../lib/gcc/x86_64-linux"..., "/usr/bin/../lib/gcc/x86_64-linux"..., "-L/usr/bin/../lib/gcc/x86_64-lin"..., "-L/usr/bin/../lib/gcc/x86_64-lin"..., "-L/lib/x86_64-linux-gnu", "-L/lib/../lib64", "-L/usr/lib/x86_64-linux-gnu", "-L/usr/bin/../lib/gcc/x86_64-lin"..., "-L/usr/lib/llvm-9/bin/../lib", "-L/lib", "-L/usr/lib", "/tmp/code-e5c53c.o", "-lm", "-lstdc++", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed", "-lc", ...], 0x7ffc24f4aa18 /* 6 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=7, si_stime=3} ---
13    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=0, si_utime=1, si_stime=0} ---
17    execve("/tmp/code", ["/tmp/code"], 0x5639ffe1fbd0 /* 6 vars */) = 0
16    execve("/bin/cat", ["cat", "-"], 0x5639ffe1fbe8 /* 6 vars */) = 0
16    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
17    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
18    execve("/bin/rm", ["rm", "/tmp/code.cpp", "/tmp/code"], 0x5639ffe1fbd0 /* 6 vars */) = 0
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} ---
10    +++ exited with 0 +++