Result

AC

Duration

555ms

Code [DL]

(""+require('fs').readFileSync(0)).split`
`.map(a=>a>"!"&&console.log(+/01/.test(a+a)))

stdin

0123
0321
2301
0123
2103
2301
1032
3210
3012
0123
2103
3012
1230
2301
1032
2103
3012
2301
1032
3012
1230
3210
1230
2103
0321
2301
0321
1230
0321
2301
0123
1230

stdout

1
0
1
1
0
1
0
0
1
1
0
1
1
1
0
0
1
1
0
1
1
0
1
0
0
1
0
1
0
1
1
1

stderr

strace

12    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7fffef820968 /* 7 vars */) = 0
13    execve("/bin/cat", ["cat", "-"], 0x7f99f9bdc230 /* 7 vars */ <unfinished ...>
14    execve("/usr/bin/node", ["/usr/bin/node", "/volume/CODE"], 0x7f99f9bdc240 /* 7 vars */ <unfinished ...>
13    <... execve resumed>)             = 0
14    <... execve resumed>)             = 0
13    +++ exited with 0 +++
12    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
17    +++ exited with 0 +++
16    +++ exited with 0 +++
19    +++ exited with 0 +++
18    +++ exited with 0 +++
15    +++ exited with 0 +++
20    +++ exited with 0 +++
14    +++ exited with 0 +++
12    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14, si_uid=0, si_status=0, si_utime=4, si_stime=0} ---
12    +++ exited with 0 +++