Result

AC

Code [DL]

for(c=new java.util.Scanner(java.lang.System.in);;)print(+!(Math.sqrt(8*c.nextInt(2)+1)%1))

stdin

00000010
01010000
01001111
01001110
01111000
00010101
10001100
10110100
00000110
00011100
01011001
10101001
10001000
10011001
11100111
00011011
01000010
11111000
01101001
01011011
10100111
10111110
00001100
10101101
11111100
00001010
00011110
00101100
00111010
11010011
00000000
10101011
00101101
01100010
00110110
10010010
00000001
10110000
11010010
11101010
10000001
00101101
11100010
00001010
00100100
00000011
00110111
00001111
00100011
11111101

stdout

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

stderr

org.mozilla.javascript.WrappedException: Wrapped java.util.NoSuchElementException
	at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1893)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
	at org.mozilla.javascript.gen._volume_CODE_1._c_script_0(Unknown Source)
	at org.mozilla.javascript.gen._volume_CODE_1.call(Unknown Source)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3282)
	at org.mozilla.javascript.gen._volume_CODE_1.call(Unknown Source)
	at org.mozilla.javascript.gen._volume_CODE_1.exec(Unknown Source)
	at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:601)
	at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:560)
	at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:531)
	at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:179)
	at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:100)
	at org.mozilla.javascript.Context.call(Context.java:501)
	at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:503)
	at org.mozilla.javascript.tools.shell.Main.exec(Main.java:161)
	at org.mozilla.javascript.tools.shell.Main.main(Main.java:136)
Caused by: java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
	... 17 more

strace