2016女生赛 1001 Solving Order
来源:互联网 发布:下载电驴软件 编辑:程序博客网 时间:2024/04/28 02:53
Solving Order
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0
Problem Description
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.
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.
Input
The first line is an integer T which indicates the case number.
And as for each case, the first line is an integern , which is the number of problems.
Then there aren 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≤n≤10 .
1≤ string length ≤10 .
1≤ bolloon numbers ≤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.
And as for each case, the first line is an integer
Then there are
It is guaranteed that:
For any two problems, their corresponding colors are different.
For any two kinds of balloons, their numbers are different.
Output
For each case, you need to output a single line.
There should ben 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.
There should be
Please make sure that there is only a blank between every two strings, and there is no extra blank.
Sample Input
33red 1green 2yellow 31blue 832red 2white 1
Sample Output
yellow green redbluered white
#include<iostream>#include<stdio.h>#include<cmath>#include<string.h>#include<queue>using namespace std;struct s{ char name[20];int num;friend bool operator < (s a,s b){return a.num<b.num;}};int main(){int t ,n,i;priority_queue<s>q;s s1;while(cin>>t){while(t--){cin>>n;for(i=0;i<n;i++){cin>>s1.name>>s1.num;q.push(s1);}while(q.size()>1){s1=q.top();cout<<s1.name<<' '; q.pop();} s1=q.top();cout<<s1.name<<endl;q.pop();}}return 0;}
0 0
- 2016女生赛 1001 Solving Order
- 【2016杭电女生赛1001】【C语言签到题】Solving Order
- HDU-5702-Solving Order【2016CCPC女生专场】
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场-1001-Solving Order
- hdoj-5702-Solving Order
- HDU 5702 Solving Order
- HDU 5702 Solving Order
- Solving Order HDU
- Hdoj 5702 Solving Order
- Hdu-5702-Solving Order [排序]
- hdu 5702 Solving Order 水题
- 2016 女生赛 1002 Desert
- 2016女生赛 1004 Clock【】
- solving
- hdu 5702 Solving Order(结构体排序 水题)
- 2017女生赛 1001 Automatic Judge【】
- 2016女生赛 1003 Luck Competition
- 2016女生赛 1005 GirlCat【DFS】
- css 背景
- mysql MHA主从切换问题实验总结
- 每天刷个算法题20160526:BFS解决八数码问题(九宫格问题)
- 不知道 Android 中 Gradle 的这些技巧,活该你加班
- 【SSH】——Hibernate(4)关联映射之单向映射
- 2016女生赛 1001 Solving Order
- Android逆向之旅---SO(ELF)文件格式详解
- Js作用域与作用域链详解
- spark-streaming入门(三)
- hdu1301 Jungle Roads
- hdu 5384 Danganronpa(AC自动机)
- 从U盘安装Centos 7错误记
- mysql MHA安装搭建问题实验总结
- Android上view或布局无法失去焦点unFocus fail的一个坑