QOJ.ac

QOJ

Límite de tiempo: 2.0 s Límite de memoria: 512 MB Puntuación total: 100 Interactivo

#11806. 最小唯一值

Estadísticas

这是一个交互式问题。

“最小唯一正整数”游戏常被用作一个规则非常简单,但计算机却很难掌握的游戏示例。

有 $n$ 名玩家参与该游戏,游戏共进行 $m$ 轮。在每一轮中,每名玩家秘密选择一个正整数。所有玩家选择的整数随后同时揭晓,选择的整数中最小且未被其他任何玩家选择的玩家赢得该轮。如果所有整数都有重复,则该轮没有赢家。

在本题中,你控制 $k$ 名玩家,其中 $k > \frac{n}{2}$(严格超过所有玩家人数的一半),你的目标是让你控制的玩家中的某一位(不一定是同一位)赢得至少 90% 的轮次。

其余 $n - k$ 名玩家将各自使用一种不依赖于你操作的预定策略进行游戏。

交互

首先,你的程序需要读取三个整数 $n$、$k$ 和 $m$($3 \le n \le 10$,$\frac{n}{2} < k < n$,$m$ 为 2 或 1000,除样例外所有情况 $m$ 均为 1000)。

然后,你需要重复以下过程 $m$ 次:你需要打印 $k$ 个 1 到 100 之间的整数(包含 1 和 100),表示你控制的玩家的操作。打印后请务必刷新输出。接着,你需要读取 $n - k$ 个整数,它们同样在 1 到 100 之间,表示该轮中其余玩家的操作。

在完成 $m$ 轮后,你的程序必须正常退出。

你的解法必须赢得至少 $0.9 \cdot m$ 轮(向上取整)。

样例

输入 1

5 3 2
1 1
2 3

输出 1

2 3 3
100 50 1

说明

在样例中,其余玩家在第一轮总是选择 1 和 1,在第二轮总是选择 2 和 3。本题共有 100 个非样例测试用例。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.