#abc286f. F - Guess The Number 2
F - Guess The Number 2
Score : points
问题描述
这是一个 交互式任务,你编写的程序和裁判程序将通过标准输入和输出进行交互。
你们将按照以下步骤进行操作。该过程包括阶段1和阶段2,阶段1紧接阶段2。
(阶段1)
- 裁判决定一个整数 ,其范围在 到 (包含)之间,但这个值是隐藏的。
- 你打印一个整数 ,其范围在 到 (包含)之间。
- 你还需打印一个长度为 的整数序列 ,其中对于所有 ,满足 。
(阶段2)
- 裁判给你一个长度为 的整数序列 。这里,。函数 定义为对于所有在 和 (包含)之间的整数 ,都有 ,而 是通过将 替换为 连续进行 次后得到的整数。
- 根据给出的 序列,你需要识别出裁判所决定的整数 ,并打印出 。
完成上述步骤后,请立即终止程序以接受正确性判断。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
You and the judge will follow the procedure below. The procedure consists of phases and ; phase is immediately followed by phase .
(Phase )
- The judge decides an integer between and (inclusive), which is hidden.
- You print an integer between and (inclusive).
- You also print an integer sequence of length such that for all .
(Phase )
- The judge gives you an integer sequence of length . Here, . is defined by for all integers between and (inclusive), and is the integer resulting from replacing with times.
- Based on the given , you identify the integer that the judge has decided, and print .
After the procedure above, terminate the program immediately to be judged correct.
Constraints
- is an integer between and (inclusive).
Input and Output
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
(Phase )
- First, print an integer between and (inclusive). It must be followed by a newline.
- Then, print a sequence of length consisting of integers between and (inclusive), with spaces in between. It must be followed by a newline.
(Phase )
- First, an integer sequence of length is given from the input.
- Find the integer and print it. It must be followed by a newline.
If you print something illegal, the judge prints -1
. In that case, your submission is already considered incorrect. Since the judge program terminates at this point, it is desirable that your program terminates too.
Notes
- After each output, add a newline and then flush Standard Output. Otherwise, you may get a TLE verdict.
- If an invalid output is printed during the interaction, or if the program terminates halfway, the verdict will be indeterminate.
- After you print the answer (or you receive
-1
), immediately terminate the program normally. Otherwise, the verdict will be indeterminate. - Note that an excessive newline is also considered an invalid input.
Sample Interaction
The following is a sample interaction with .
Input | Output | Description |
---|---|---|
The judge has decided that $N=2$. $N$ is hidden: it is not given as an input. | ||
4 | You print $M$. | |
2 3 4 4 | You print $A=(2,3,4,4)$. | |
3 4 4 4 | $f^2(1)=3,f^2(2)=4,f^2(3)=4$, and $f^2(4)=4$, so the judge gives $B=(3,4,4,4)$ to your program. | |
2 | Based on $B$, you have identified that $N=2$. Print $N$ and terminate the program normally. | |
update @ 2024/3/10 11:58:26