TWINS

시간 제한0.5초메모리 제한1024 MB

요약
부분집합에 특별한 사진이 하나 이상 있는지 묻는 일괄 질의로 N장 중 하나 또는 둘인 특별한 사진을 찾아낸다.
난이도

어려움10점 중 8점

유형
이분 탐색, 그리디, 분할 정복, 구현
정답자
아직 제출이 없습니다

문제

Once again, the twins Reni and Nora managed to fool everybody by switching places. Alex was convinced that he had figured out a strategy for telling them apart. But it turns out he was wrong. Reni and Nora, knowing that he is hopelessly confused, decide to try one of their newly invented games. It consisted of the following:

They choose NN different pictures of themselves, numbered from 11 to NN, one or two of which are of Reni and the rest are of Nora. Alex is allowed to ask questions like: "Among the pictures with numbers p_1, p_2, ... p_K (1≤K≤N)p\_1,\ p\_2,\ ...\ p\_K\ (1 \leq K \leq N), is there at least one picture of Reni?". However, to make it more interesting, he can submit a whole group with several such questions and receive the answers to each of them at the same time.

The purpose of the game for Alex is to guess which pictures are of Reni and which are of Nora after some finite number of questions (which in itself would be an achievement for him), but also to minimize both the number of question groups and the total number of questions in them. He needs your help for this. Write a program twins that finds the required one or two pictures.

Write a program twins that, determines which of the pictures are of Reni and which are of Nora. It must contain the function play that will be compiled with the jury's program.

제한

  • 15≤N≤50 00015 \leq N \leq 50\ 000
  • 1≤T≤21 \leq T \leq 2

예제

이 문제는 공개된 예제가 없습니다.