QOJ.ac

QOJ

时间限制: 4.0 s 内存限制: 512 MB 总分: 100 可 Hack ✓

#7041. 少女乐团派对

统计

你正在玩一款名为“Garupa”的游戏。在游戏的一个活动中,你正试图获得更多的活动点数。你有 $n$ 张卡牌,每张卡牌都有自己的名字、颜色和力量值。当你进行游戏时,你可以将五张名字不同的卡牌放入你的卡组。本次活动的基准点数是卡组中卡牌力量值之和。此外,活动还会公布一种颜色和五个名字作为加成属性,这意味着卡组中每有一张卡牌的颜色与加成颜色相同,你的活动点数就会增加 20%;每有一张卡牌的名字与加成名字相同,你的活动点数就会增加 10%(加成值通过相加计算,在计算最终活动点数时向下取整)。请找出你最终能获得的最高活动点数。

输入格式

第一行是一个整数 $T$ ($1 \le T \le 50$),表示测试用例的数量。

对于每组输入数据,第一行输入一个正整数 $n$ ($5 \le n \le 100000$),表示你拥有的卡牌数量。

接下来的 $n$ 行中,第 $i$ 行输入两个字符串 $name_i$、$color_i$ 和一个正整数 $power_i$ ($1 \le power_i \le 50000$),用空格分隔,分别表示第 $i$ 张卡牌的名字、颜色和力量值。输入数据保证至少有五张名字不同的卡牌。

接下来一行输入五个字符串,表示五个加成名字。输入数据保证这五个加成名字各不相同。

最后一行输入一个字符串,表示加成颜色。

输入数据保证所有字符串仅由大小写字母组成,且最大长度为 10,所有测试用例中 $n$ 的总和不超过 1500000。

输出格式

对于每组数据,仅输出一行正整数,表示你最终能获得的最高活动点数。

样例

输入 1

1
6
Saaya Power 45000
Kokoro Happy 45000
Kasumi Cool 45000
Rimi Power 45000
Aya Pure 45000
Aya Power 2000
Saaya Tae Kasumi Rimi Arisa
Power

输出 1

382500

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.