Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

By solving this problem, you can learn (or reconfirm) how to implement binary search.

The output is self-descriptive. Please read it and consider what is going on.

In this implementation, the lower boundary of the value range is inclusive

and the upper boundary is exclusive.

The initial value of the lower boundary is zero. The upper boundary is given

in the first line of the input.

Then you must make a query whether the value is in the lower half of the range.

The answer to the query, expressed as 1 for yes or 0 for no, is given in the

next line of the input.

Repeat the above until you can determine the value which is an integer.

You must ignore the remaining input that is just a garbage.

-- tails

exec is denied

no deadline, the server will not save your submission

1024 1 1 1 0 0 1 1 0 1 1 0 0 1

Now I know the value is not less than 0 but less than 1024. Is the value less than 512? Yes! Now I know the value is not less than 0 but less than 512. Is the value less than 256? Yes! Now I know the value is not less than 0 but less than 256. Is the value less than 128? Yes! Now I know the value is not less than 0 but less than 128. Is the value less than 64? No! Now I know the value is not less than 64 but less than 128. Is the value less than 96? No! Now I know the value is not less than 96 but less than 128. Is the value less than 112? Yes! Now I know the value is not less than 96 but less than 112. Is the value less than 104? Yes! Now I know the value is not less than 96 but less than 104. Is the value less than 100? No! Now I know the value is not less than 100 but less than 104. Is the value less than 102? Yes! Now I know the value is not less than 100 but less than 102. Is the value less than 101? Yes! Now I know the value is not less than 100 but less than 101. That is, the value is 100.

3456 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0

Now I know the value is not less than 0 but less than 3456. Is the value less than 1728? Yes! Now I know the value is not less than 0 but less than 1728. Is the value less than 864? No! Now I know the value is not less than 864 but less than 1728. Is the value less than 1296? Yes! Now I know the value is not less than 864 but less than 1296. Is the value less than 1080? No! Now I know the value is not less than 1080 but less than 1296. Is the value less than 1188? No! Now I know the value is not less than 1188 but less than 1296. Is the value less than 1242? Yes! Now I know the value is not less than 1188 but less than 1242. Is the value less than 1215? No! Now I know the value is not less than 1215 but less than 1242. Is the value less than 1228? No! Now I know the value is not less than 1228 but less than 1242. Is the value less than 1235? Yes! Now I know the value is not less than 1228 but less than 1235. Is the value less than 1231? No! Now I know the value is not less than 1231 but less than 1235. Is the value less than 1233? No! Now I know the value is not less than 1233 but less than 1235. Is the value less than 1234? No! Now I know the value is not less than 1234 but less than 1235. That is, the value is 1234.

7777 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0

Now I know the value is not less than 0 but less than 7777. Is the value less than 3888? No! Now I know the value is not less than 3888 but less than 7777. Is the value less than 5832? Yes! Now I know the value is not less than 3888 but less than 5832. Is the value less than 4860? No! Now I know the value is not less than 4860 but less than 5832. Is the value less than 5346? No! Now I know the value is not less than 5346 but less than 5832. Is the value less than 5589? Yes! Now I know the value is not less than 5346 but less than 5589. Is the value less than 5467? No! Now I know the value is not less than 5467 but less than 5589. Is the value less than 5528? No! Now I know the value is not less than 5528 but less than 5589. Is the value less than 5558? Yes! Now I know the value is not less than 5528 but less than 5558. Is the value less than 5543? No! Now I know the value is not less than 5543 but less than 5558. Is the value less than 5550? No! Now I know the value is not less than 5550 but less than 5558. Is the value less than 5554? No! Now I know the value is not less than 5554 but less than 5558. Is the value less than 5556? Yes! Now I know the value is not less than 5554 but less than 5556. Is the value less than 5555? No! Now I know the value is not less than 5555 but less than 5556. That is, the value is 5555.

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | Histocrat | 184 | 0.0461 | 2016/08/20 13:54:15 | 0B / 90B / 77B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | letranger | 220 | 0.1539 | 2017/09/18 14:11:30 | 0B / 104B / 93B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | %20 | 176 | 0.0406 | 2016/08/18 13:46:22 | 0B / 68B / 91B |

2 | tails | 269 | 0.0380 | 2016/08/18 11:05:05 | 0B / 150B / 78B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | hallvabo | 184 | 0.1268 | 2017/01/08 06:11:26 | 101B / 54B / 25B |

2 | twobit | 197 | 0.0989 | 2017/01/07 01:27:15 | 115B / ?B / ?B |

3 | hallvabo (nobin) | 213 | 0.1089 | 2017/01/08 05:41:54 | 0B / 113B / 81B |

4 | Sp3000 | 216 | 0.1021 | 2016/08/29 15:19:52 | 0B / 113B / 85B |

5 | test | 256 | 0.1215 | 2017/01/07 00:31:49 | 0B / ?B / ?B |

6 | rolf | 257 | 0.0974 | 2016/08/19 03:36:44 | 0B / 151B / 75B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | mypetlion | 222 | 0.1264 | 2020/01/21 09:19:10 | 0B / 111B / 99B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | ETHproductions | 203 | 0.0639 | 2017/03/30 08:12:28 | 0B / 98B / 99B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | tehtmi | 236 | 0.0398 | 2018/08/27 14:33:51 | 1B / 131B / 81B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | rotary-o | 233 | 0.0411 | 2021/05/05 21:59:43 | 0B / 125B / 94B |

2 | kotatsugame | 247 | 0.0320 | 2017/02/01 23:17:41 | 0B / 144B / 80B |

3 | nai | 248 | 0.0355 | 2016/12/20 00:35:16 | 0B / 149B / 75B |

4 | yangfl | 260 | 0.0357 | 2016/10/27 23:37:56 | 0B / 151B / 85B |

5 | bk1e | 272 | 0.0383 | 2017/04/18 15:55:34 | 0B / 157B / 92B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | rotary-o | 299 | 0.2254 | 2021/05/05 21:47:09 | 0B / 172B / 108B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | McBusLuck | 238 | 0.0229 | 2020/04/20 15:28:21 | 0B / 134B / 70B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | rotary-o | 226 | 7.0057 | 2021/05/05 21:45:46 | 0B / 125B / 84B |

2 | clock | 232 | 6.3196 | 2020/05/08 02:25:49 | 0B / 128B / 83B |

Rank | Lang | User | Size | Score |
---|---|---|---|---|

1 | Perl | %20 | 176 | 10000 |

2 | Ruby | Histocrat | 184 | 9565 |

3 | Python | hallvabo | 184 | 9565 |

4 | JavaScript | ETHproductions | 203 | 8669 |

5 | Ruby2 | letranger | 220 | 8000 |

6 | Python3 | mypetlion | 222 | 7927 |

7 | Scala | rotary-o | 226 | 7787 |

8 | C | rotary-o | 233 | 7553 |

9 | Lua | tehtmi | 236 | 7457 |

10 | bc | McBusLuck | 238 | 7394 |

11 | Java | rotary-o | 299 | 5886 |