当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6666:Quailty and CCPC

题目描述
Considering the overall difficulty of other problems, we invite Quailty to propose an easy problem for this contest.

Quailty accidentally won both gold medal and silver medal in 2017 CCPC final. The reason is explained as follows. According to the official rule, the number of gold medals was 10\% of the number of participating teams, rounded to the nearest integer. This is ambiguous when the fractional part of the result is exactly $0.5$. There were 115 participating teams, and the rank of Quailty's team was 12. The organizer originally decided to round down the number, so there were only 11 gold medals, and Quailty's team could only win the silver medal. Many people defended him against the organizer, saying that his team deserved a gold medal. Later, the organizer changed to round up the number, and Quailty's team finally won a gold medal.

Now, give you the scoreboard of a contest and the proportion of gold medal teams, could you determine whether there exists a team, such that they would win a gold medal were the number of gold medals rounded up when the fractional part is exactly $0.5$, and silver medal if rounded down?

A team ranks before another if they solved more problems or both teams solved an equal number of problems but they had less penalty time.

(Disclaimer: the background is fictitious and the problem is prepared by Nanjing University ICPC Training Team, not Quailty.)
输入解释
The first line of input consists of a single integer $T$ $(1 \leq T \leq 120)$, denoting the number of test cases.

Each test case starts with a line of two integers $n$ $(1 \leq n \leq 10^5)$, denoting the number of participating teams, and $d$ $(0 \leq d \leq 9)$, denoting that the proportion of gold medal teams is $10d\%$. For the next $n$ lines, each containing a string $s$ and two integers $p, t$ $(0 \leq p, t \leq 10^9)$, denoting the name of the team, the number of problems solved and the penalty time of the team, respectively. The name of the each team contains at least 1 and at most 10 latin letters. The names are case sensitive. No two teams have the same name. No two teams have the same penalty time. The sum of $n$ over all test cases does not exceed $10^6$.
输出解释
For each test case, print the team name if there exists such team, or print $\texttt{Quailty is very great}$ otherwise. It can be proved that there is at most one such team.
输入样例
2
5 1
Ace 1000 0
Luffy 999 1
Sabo 998 2
Roronoa 997 3
Sanji 996 4
2 3
You 0 0
I 10 1
输出样例
Ace
Quailty is very great
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6666

最后修改于 2020-10-25T23:33:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/2000MS(Java/Others) 131072/131072K(Java/Others)