#abc244c. C - Yamanote Line Game(等待交互评测程序)
C - Yamanote Line Game(等待交互评测程序)
Score : points
问题陈述
高桥和青木将进行以下对决游戏。
从高桥开始,两人交替声明一个介于 和 (包含)之间的整数,直到游戏结束。任何一方声明过的整数,双方都不能再次声明。无法再声明整数的玩家判负;未输掉比赛的玩家即为胜者。
在这场游戏中,高桥总是会赢。你的任务是代表高桥实际进行游戏,并赢得比赛。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi and Aoki will play the following game against each other.
Starting from Takahashi, the two alternatingly declare an integer between and (inclusive) until the game ends. Any integer declared by either player cannot be declared by either player again. The player who is no longer able to declare an integer loses; the player who didn't lose wins.
In this game, Takahashi will always win. Your task is to actually play the game on behalf of Takahashi and win the game.
Constraints
- is an integer.
输入与输出
此任务是一个交互式任务(你的程序通过输入输出与评判程序进行互动)。 你的程序代表 Takahashi 进行游戏,评判程序代表 Aoki 进行游戏。
首先,你的程序从标准输入获得一个正整数 。然后,重复以下程序直到游戏结束。
- 你的程序向标准输出输出一个介于 和 (包含两端)的整数,这定义了 Takahashi 声明的整数。(你不能输出已经被任一玩家声明过的整数。)
- Aoki 声明的整数由评判程序从标准输入提供给你的程序。(不会被任一玩家声明过的整数将不会被提供。)如果 Aoki 没有更多的整数可以声明,将提供 代替,这意味着游戏结束并且 Takahashi 获胜。
注意事项
- 每次输出后,你必须刷新标准输出。否则,你可能会得到 TLE(超时)错误。
- 游戏结束后并且 Takahashi 获胜,程序必须立即终止。 否则,评判不一定会给出 AC(正确)。
- 如果你的程序输出违反游戏规则的内容(例如已经被任一玩家声明过的整数),你的答案将被视为不正确。在这种情况下,判决是不确定的。它不一定给出 WA(错误答案)。
示例输入与输出
输入 | 输出 | 描述 |
---|---|---|
首先,给出一个整数 。 | ||
Takahashi 声明整数 。 | ||
Aoki 声明整数 。 | ||
Takahashi 声明整数 。 | ||
Aoki 声明整数 。 | ||
Takahashi 声明整数 。 | ||
Aoki 没有更多的整数可以声明,因此 Takahashi 获胜,游戏结束。 |
Input and Output
This task is an interactive task (in which your program and the judge program interact with each other via inputs and outputs). Your program plays the game on behalf of Takahashi, and the judge program plays the game on behalf of Aoki.
First, your program is given a positive integer from Standard Input. Then, the following procedures are repeated until the game ends.
- Your program outputs an integer between and (inclusive) to Standard Output, which defines the integer that Takahashi declares. (You cannot output an integer that is already declared by either player.)
- The integer that Aoki declares is given by the judge program to your program from Standard Input. (No integer that is already declared by either player will be given.) If Aoki has no more integer to declare, is given instead, which means that the game ended and Takahashi won.
Notes
- After each output, you must flush Standard Output. Otherwise, you may get TLE.
- After the game ended and Takahashi won, the program must be terminated immediately. Otherwise, the judge does not necessarily give AC.
- If your program outputs something that violates the rules of the game (such as an integer that has already been declared by either player), your answer is considered incorrect. In such case, the verdict is indeterminate. It does not necessarily give WA.
Sample Input and Output
Input | Output | Description |
---|---|---|
$2$ | First, an integer $N$ is given. | |
$1$ | Takahashi declares an integer $1$. | |
$3$ | Aoki declares an integer $3$. | |
$2$ | Takahashi declares an integer $2$. | |
$4$ | Aoki declares an integer $4$. | |
$5$ | Takahashi declares an integer $5$. | |
$0$ | Aoki has no more integer to declare, so Takahashi wins, and the game ends. |
update @ 2024/3/10 10:28:54