아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Jump

시간 제한2초메모리 제한512 MB

요약
일치하는 비트 수에 따라 n, n/2, 0을 돌려주는 질의로 숨겨진 비트 문자열을 알아낸다.
난이도

어려움10점 중 8점

유형
수학, 비트 연산, 분할 정복
정답자
아직 제출이 없습니다

문제

Consider a toy interactive problem OneMaxOneMax which is defined as follows. You know an integer nn and there is a hidden bit string SS of length nn. The only thing you may do is to present the system a bit string QQ of length nn, and the system will return the number OneMax(Q)OneMax(Q) --- the number of bits which coincide in QQ and SS at the corresponding positions. The name of OneMaxOneMax problem stems from the fact that this problem is simpler to explain when S=111…11S = 111\ldots11, so that the problem turns into maximization (MaxMax) of the number of ones (OneOne).

When nn is even, there is a similar (but harder) interactive problem called JumpJump. The simplest way to describe the JumpJump is by using OneMaxOneMax: \begin{equation\*} Jump(Q) = \begin{cases} OneMax(Q) & \text{if } OneMax(Q) = n \text{ or } OneMax(Q) = n/2;\\\ 0 & \text{otherwise}. \end{cases} \end{equation\*}

Basically, the only nonzero values of OneMaxOneMax which you can see with JumpJump are nn (which means you've found the hidden string SS) and n/2n/2.

Given an even integer nn --- the problem size, you have to solve the JumpJump problem for the hidden string SS by making interactive JumpJump queries. Your task is to eventually make a query QQ such that Q=SQ = S.

입력

The first line of the input stream contains an even number nn (2≤n≤10002 \le n \le 1000). The next lines of the input stream consist of the answers to the corresponding queries. Each answer is an integer --- either 00, n/2n/2, or nn. Each answer is on its own line.

출력

To make a query, print a line which contains a string of length nn which consists of characters 0 and 1 only. Don't forget to put a newline character and to flush the output stream after you print your query.

예제1

  1. 예제 1

    입력
    2
    1
    0
    1
    2
    
    예상 출력
    01
    11
    10
    00