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

建议使用的浏览器:

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

5702:Solving Order

题目描述
Welcome to HDU to take part in the first CCPC girls' competition!



As a pretty special competition, many volunteers are preparing for it with high enthusiasm.
One thing they need to do is blowing the balloons.

Before sitting down and starting the competition, you have just passed by the room where the boys are blowing the balloons. And you have found that the number of balloons of different colors are strictly different.

After thinking about the volunteer boys' sincere facial expressions, you noticed that, the problem with more balloon numbers are sure to be easier to solve.

Now, you have recalled how many balloons are there of each color.
Please output the solving order you need to choose in order to finish the problems from easy to hard.
You should print the colors to represent the problems.
输入解释
The first line is an integer $T$ which indicates the case number.
And as for each case, the first line is an integer $n$, which is the number of problems.
Then there are $n$ lines followed, with a string and an integer in each line, in the $i$-th line, the string means the color of ballon for the $i$-th problem, and the integer means the ballon numbers.

It is guaranteed that:
$T$ is about 100.
$1\leq n\leq 10$.
$1\leq$ string length $\leq 10$.
$1\leq$ bolloon numbers $\leq 83$.(there are 83 teams :p)
For any two problems, their corresponding colors are different.
For any two kinds of balloons, their numbers are different.
输出解释
For each case, you need to output a single line.
There should be $n$ strings in the line representing the solving order you choose.
Please make sure that there is only a blank between every two strings, and there is no extra blank.
输入样例
3
3
red 1
green 2
yellow 3
1
blue 83
2
red 2
white 1
输出样例
yellow green red
blue
red white
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-5702

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

共提交 0

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