QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100 Hackeable ✓

#8308. 文物

Estadísticas

《原神》是一款由米哈游开发的开放世界游戏。作为主角,你是一对旅行的双子,在旅途中穿梭于无数世界。当你降临在名为提瓦特的大陆时,你本希望能够在这里享受时光。但当你从流星中醒来,你看到世界陷入动荡,灾难在大陆上肆虐……

你试图离开这个地方前往下一个世界,但一位陌生的神灵挡在了你的面前。这位神灵高高在上,凌驾于混乱的世界之上。神灵带走了你唯一的亲人,并将你封印,使你陷入了充满噩梦的沉睡……

当你再次醒来时,世界已经改变。战火不再,一切熟悉的事物都已消失。你沉睡了多久?你没有答案。

于是你开始了孤独的旅程,寻找你曾经见过的神灵……

在这个世界中,你可以装备圣遗物来增强你的实力。圣遗物共有五种:生之花、死之羽、时之沙、空之杯、理之冠。你可以为每种圣遗物装备最多一件,也可以选择不装备某些种类的圣遗物。

每件圣遗物都有 5 条属性值。保证这些属性值的类型各不相同。共有 12 种属性类型,包括:HP、ATK、HP Rate、ATK Rate、DEF Rate、Physical DMG Rate、Elemental DMG Rate、Elemental Mastery、Energy Recharge Rate、Crit Rate、Crit DMG Rate、Healing Bonus Rate。

在这里,我们只关心 ATK、ATK Rate、Crit DMG Rate 和 Crit Rate(暴击率)。你初始拥有 1500 点 ATK、5% 的 Crit Rate 和 50% 的 Crit DMG Rate 作为基础值。当装备圣遗物后,若总 ATK Rate 为 $x\%$,ATK 为 $y$,则新的 ATK 将变为 $1500 \times (1 + x) + y$。此时,我们可以定义期望伤害 $E$ 为:

$$E = \text{ATK} \times (1 - (\text{Crit Rate})) + \text{ATK} \times (1 + (\text{Crit DMG Rate})) \times (\text{Crit Rate})$$

特别地,如果 Crit Rate 超过 100%,则按 100% 计算。

现在给你 5 件圣遗物,每种类型各一件。你需要计算当你装备这 5 件圣遗物时的期望伤害 $E$。

输入格式

输入包含 $5 \times 5$ 行,每 5 行描述一件圣遗物。在每 5 行中,每一行包含一个描述五条属性值之一的字符串。

对于每个属性值字符串,它将以 “typename+x” 或 “typename+x%” 的格式给出。$x$ 是一个不超过 2 位小数的非负实数。保证 typename 是上述 12 种类型之一。当 typename 为某种 Rate 时,末尾会有 “%”,且 $x$ 满足 $0 \le x \le 100$。否则,$x$ 为 $[0, 1000]$ 范围内的实数。

输出格式

输出一个实数表示答案。如果你的答案与标准答案的绝对误差或相对误差不超过 $10^{-6}$,则视为正确。

形式化地说,假设你的输出为 $x$,标准答案为 $y$,若满足 $\frac{|x-y|}{\max(1,|y|)} \le 10^{-6}$,则你的输出被接受。

样例

样例输入 1

ATK+10.00
ATK Rate+10%
Crit Rate+10.00%
HP+10.00
DEF Rate+10.00%
Energy Recharge Rate+10.00%
ATK+10.00
Crit Rate+10.00%
Crit DMG Rate+10.00%
DEF Rate+10%
ATK+10.00
ATK Rate+10.00%
Elemental DMG Rate+10%
Crit DMG Rate+10.00%
Crit Rate+10.00%
Crit DMG Rate+10.00%
ATK Rate+10%
Healing Bonus Rate+10.00%
HP+10
DEF Rate+10.00%
ATK+10
ATK Rate+10%
HP Rate+10.00%
HP+10
DEF Rate+10.00%

样例输出 1

2739.2000000000

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.