Binary String

숨겨진 1000비트 이진 문자열을 찾는다. 각 질의는 구간의 실제 1의 개수이거나 무작위로 고른 다른 값이며, 같은 구간을 두 번 질의할 수 없다.

어려움8확률구현아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

This is an interactive problem.

The jury has a secret string which consists of exactly 10001000 binary digits. In each test for this problem, the string is fixed in advance and does not change. You have to find this string using queries.

In each query, you choose a segment \[a,b]\[a, b] (1ab10001 \leq a \leq b \leq 1000) to ask about. Then the jury flips a coin, and gives you one of the two values, each with probability of 50%:

  1. The number of 11s in the segment \[a,b]\[a, b]
  2. A value from 00 to ba+1b - a + 1 which is not equal to the number of ones on this segment, chosen uniformly at random.

You are not allowed to use the same query twice. All random values used in this problem are uniform and independent.

힌트

The example above is given only to demonstrate the format. In this example, the string has length 55. In the real first test, as well as all other tests, the length of the string to guess is exactly 10001000.