CF1137D.Cooperative Game
提高+/省选-
通过率:0%
时间限制:1.00s
内存限制:512MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come up with a field for the upcoming game. The field for this game is a directed graph consisting of two parts. The first part is a road along the coast of the lake which is a cycle of c vertices. The second part is a path from home to the lake which is a chain of t vertices, and there is an edge from the last vertex of this chain to the vertex of the road along the coast which has the most beautiful view of the lake, also known as the finish vertex. Misha decided to keep the field secret, so nobody knows neither t nor c.

Note that each vertex of the field has exactly one outgoing edge and all the vertices except the home vertex and the finish vertex have exactly one ingoing edge. The home vertex has no incoming edges, the finish vertex has two incoming edges.
At the beginning of the game pieces of all the ten players, indexed with consecutive integers from 0 to 9, are at the home vertex. After that on each turn some of the players can ask Misha to simultaneously move their pieces along the corresponding edges. Misha will not answer more than q such queries. After each move Misha will tell players whose pieces are at the same vertices and whose pieces are at different vertices.
The goal of the game is to move all the pieces to the finish vertex. Misha's friends have no idea how to win in such a game without knowledge of c, t and q, but luckily they are your friends. Help them: coordinate their actions to win the game.
Misha has drawn such a field that 1≤t,c, (t+c)≤1000 and q=3⋅(t+c).
这是一个交互式问题。
米沙喜欢玩信息不完全的合作类游戏。今天,他邀请了十位朋友一起玩一款合作类游戏——“湖”。
米沙已经为即将开始的游戏设计好了场地。该游戏的场地是一个有向图,由两部分组成:第一部分是沿湖岸修建的一条道路,它是一个包含 c 个顶点的环;第二部分是一条从家通往湖边的道路,它是一条包含 t 个顶点的链,并且该链的最后一个顶点有一条有向边指向湖岸道路上风景最优美的那个顶点(即终点顶点)。米沙决定将场地保密,因此无人知晓 t 和 c 的具体取值。

注意:场地中每个顶点恰好有一条出边;除起点(家)顶点和终点(风景最优美的顶点)外,其余所有顶点恰好有一条入边;起点顶点没有入边,终点顶点有两条入边。
游戏开始时,编号为 0 至 9 的十名玩家的棋子均位于起点(家)顶点。此后,每一轮中,部分玩家可共同请求米沙将他们各自的棋子同时沿对应的有向边移动一步。米沙至多回答 q 次此类请求。每次移动后,米沙会告知玩家们:哪些玩家的棋子位于同一顶点,哪些玩家的棋子位于不同顶点。
本游戏的目标是让所有棋子最终都到达终点顶点。米沙的朋友们完全不知道 c、t 和 q 的取值,因此不知如何获胜;但幸运的是,他们是你的朋友。请帮助他们:协调各位玩家的行动,以确保赢得游戏。
米沙所绘制的场地满足 1≤t,c,且 (t+c)≤1000,并设 q=3⋅(t+c)。
输入格式
There is no input — go to the interaction part straight away.
没有输入——请直接进入交互部分。
输出格式
After all friends gather at the finish vertex, print "done" and terminate your program.
当所有朋友都到达终点顶点后,输出 "done" 并终止程序。
输入输出样例
输入#1
2 05 12346789 3 246789 135 0 3 246789 0 135 3 246789 0 135 2 135 0246789 1 0123456789
输出#1
next 0 5 next 0 1 3 next 2 3 0 1 4 5 6 7 8 9 next 9 8 7 6 5 4 3 2 1 0 next 0 1 3 5 next 1 3 5 done
说明/提示
In the sample input and output values are aligned only for simplicity of interpreting them chronologically. In real interaction no "extra" line breaks should appear.
In the example, the friends move as follows:

在样例输入和输出中,数值仅为了便于按时间顺序理解而对齐。在实际交互中,不应出现任何“额外”的换行。
在该示例中,朋友们的移动过程如下:

输入解题思路,AI测评打分。不知道怎么写?