Comedy's Not Omnipotent

시간 제한4초메모리 제한2048 MB

요약
길이 100000인 무작위 이진 수열을, 전체 크기가 3n 이하인 부분집합 합 질의를 n/2번 미만 사용해 알아낸다.
난이도

보통10점 중 6점

유형
수학, 확률, 그리디
정답자
아직 제출이 없습니다

문제

This is an interactive problem.

Vim, Emacs, and Nano are playing a guessing game. Vim secretly told Nano a random binary sequence a_i\\{a\_i\\} of length nn. Emacs can query Nano with a set of indices I⊆1,2,…,nI \subseteq \\{1, 2, \ldots, n\\}. Nano will reply with ∑_i∈Ia_i\sum\_{i \in I} a\_i. Could you please help Emacs find a_i\\{a\_i\\} in less than n/2n/2 queries? Additionally, the total size of the sets in all queries must not be greater than 3n3n.

힌트

The size n=105n = 10^5 in all tests. The example with n=4n = 4 shows the format but will not be tested.

There are at most 5050 tests in this problem. The tests were generated randomly, but are fixed in advance. In each test, every binary sequence of length nn had the probability of 1/2n1/2^n to be generated.

예제1

  1. 예제 1

    입력
    4
    2
    1
    2
    
    예상 출력
    ? 4 1 2 3 4
    ? 2 1 2
    ? 2 2 3
    = 0110