Result

AC

Duration

632ms

Code [DL]

for i = 1 to 30 do
let s=read_line()^"__" in
let rec f x i = if s.[i]=='|' then f (x+1) (i+1) else if s.[i+1]=='|' then f (x+1) (i+2) else x in
print_int(f 0 0);
print_newline()
done

stdin

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

stdout

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

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffc25318c20 /* 7 vars */) = 0
12    execve("/usr/bin/ocaml", ["/usr/bin/ocaml", "/volume/CODE"], 0x556d3e8a0d40 /* 7 vars */ <unfinished ...>
11    execve("/bin/cat", ["cat", "-"], 0x556d3e8a0d30 /* 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 resumed>)             = 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=1, si_stime=1} ---
10    +++ exited with 0 +++