#P15509. [CEOI 2014] Carnival

    ID: 15392 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2014交互题Special JudgeCEOI(中欧)

[CEOI 2014] Carnival

Description

Each of Peter’s NN friends (numbered from 11 to NN) bought exactly one carnival costume in order to wear it at this year’s carnival parties. There are CC different kinds of costumes, numbered from 11 to CC. Some of Peter’s friends, however, might have bought the same kind of costume. Peter would like to know which of his friends bought the same costume. For this purpose, he organizes some parties, to each of which he invites some of his friends. Peter knows that on the morning after each party he will not be able to recall which costumes he will have seen the night before, but only how many different kinds of costumes he will have seen at the party. Peter wonders if he can nevertheless choose the guests of each party such that he will know in the end, which of his friends had the same kind of costume. Help Peter!

Interaction

Your program must interact with the grader via standard input and output.

First, your program must read a line that contains the number NN of friends.

Then, your program should interact with the grader as follows: To specify a party, it outputs a single line; this line contains the number kk of people to invite (1kN1 \leq k \leq N), followed by a list of the numbers of people to invite to this party (see example). Don’t forget to flush the output (for example, using fflush(stdout); or cout << endl;)! Afterwards, your program must read the answer: one line with the number of different kinds of costumes that were worn by his friends at this party.

As soon as your program has determined which friend bought which costume, it should output this result in one line. This line starts with the number 00, followed by NN space separated integers c1,,cNc_1, \ldots, c_N (1ciC1 \leq c_i \leq C for all ii): cic_i specifies the kind of costume that friend number ii has bought. The numbering of the kinds of costumes does not matter; it is only necessary that identical costumes have identical numbers and that different costumes have different numbers and that the costumes all have numbers between 11 and CC.

Immediately afterwards, your program must terminate (with return 0;).

Hint

Sample 1

The first example is about 55 friends with costume numbers 11 22 11 33 22. In the example interaction, the lines beginning with grader describe the input read by a solution program. The lines beginning with program describe the output of the solution program. The parties specified in the first example do not suffice to safely determine the costume assignment, of course – the solution program was just lucky to guess correctly.

Sample 2

The second example is about 33 friends with costume numbers 11 22 11, and it is sufficient to specify these two parties to determine the costume assignment.

Constraints and grading

We always have 2N1502 \leq N \leq 150.

If your program needs to specify PP parties to determine the costume assignment for a test case, it will score

  • 00 points if 11500<P11\,500 < P,
  • 20%20\% of all points if 3500<P115003\,500 < P \leq 11\,500 and
  • all points if P3500P \leq 3\,500.