QOJ.ac

QOJ

Límite de tiempo: 10 s Límite de memoria: 1024 MB Puntuación total: 100

#3495. 属性相克表

Estadísticas

你正在玩 Nudgémon 游戏,其中一个常见的元素是 Nudgémon 对战。在对战中,你和对手首先各自派出选择的 Nudgémon,然后轮流攻击对方的 Nudgémon。

每个攻击都有一个类型($1$ 到 $n$ 之间的整数),而对方的 Nudgémon 拥有一种或两种类型。根据这些类型,攻击会造成不同程度的伤害。

当类型为 $i$ 的攻击击中单类型为 $j$ 的 Nudgémon 时,攻击会获得伤害倍率 $a(i, j)$,其中 $a$ 是一个由 $\{0, 0.5, 1, 2\}$ 中的值组成的属性克制表。如果它击中具有 $j$ 和 $k$ 两种类型的 Nudgémon,它会获得 $a(i, j) \cdot a(i, k)$ 的伤害倍率。

根据伤害倍率 $v$ 的值,游戏会发出不同的消息:

$v$ 的值 消息 符号
$v = 0$ It had no effect. x
$0 < v < 1$ It’s not very effective... -
$v = 1$ =
$v > 1$ It’s super effective! +

你是这个游戏的新手,不知道表 $a$ 的具体内容。为了学习它的第一行,你收集了一些关于使用类型 $1$ 的攻击攻击各种 Nudgémon 时游戏输出的观察结果。现在,你试图以一种与这些数据一致的方式重构第一行。

输入格式

第一行包含两个整数 $n$ 和 $m$ ($1 \le n \le 10^5$, $1 \le m \le 10^5$),其中 $n$ 是类型数量,$m$ 是观察次数。

接下来 $m$ 行,每行包含两个整数 $i, j$ 和一个字符 $c$ ($1 \le i, j \le n$ 且 $c$ 为 x, -, = 或 + 中的一个),其中 $c$ 是使用类型 $1$ 的攻击攻击具有类型 $i$ 和 $j$ 的 Nudgémon 时观察到的效果,如上表所示。如果 $i = j$,则该 Nudgémon 仅具有单一类型。

输出格式

输出一行包含 $n$ 个字符,每个字符为 x, -, = 或 +。第 $i$ 个字符应描述使用类型 $1$ 的攻击攻击类型为 $i$ 的 Nudgémon 时的效果。

如果有多个有效的解决方案,你可以输出其中任意一个。保证至少存在一个解。

样例

输入 1

5 5
1 2 -
2 4 -
4 5 x
2 3 =
3 4 +

输出 1

=-+=x

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.