POJ 1581 A Contesting Decision
来源:互联网 发布:淘宝网棉背心 编辑:程序博客网 时间:2024/05/16 04:52
英文烂果然是硬伤啊。。。水题都要提交3次!!!
Description
Judging a programming contest is hard work, with demanding contestants, tedious decisions,and monotonous work. Not to mention the nutritional problems of spending 12 hours with only donuts, pizza, and soda for food. Still, it can be a lot of fun.
Software that automates the judging process is a great help, but the notorious unreliability of some contest software makes people wish that something better were available. You are part of a group trying to develop better, open source, contest management software, based on the principle of modular design.
Your component is to be used for calculating the scores of programming contest teams and determining a winner. You will be given the results from several teams and must determine the winner.
Scoring
There are two components to a team's score. The first is the number of problems solved. The second is penalty points, which reflects the amount of time and incorrect submissions made before the problem is solved. For each problem solved correctly, penalty points are charged equal to the time at which the problem was solved plus 20 minutes for each incorrect submission. No penalty points are added for problems that are never solved.
So if a team solved problem one on their second submission at twenty minutes, they are charged 40 penalty points. If they submit problem 2 three times, but do not solve it, they are charged no penalty points. If they submit problem 3 once and solve it at 120 minutes, they are charged 120 penalty points. Their total score is two problems solved with 160 penalty points.
The winner is the team that solves the most problems. If teams tie for solving the most problems,then the winner is the team with the fewest penalty points.
Software that automates the judging process is a great help, but the notorious unreliability of some contest software makes people wish that something better were available. You are part of a group trying to develop better, open source, contest management software, based on the principle of modular design.
Your component is to be used for calculating the scores of programming contest teams and determining a winner. You will be given the results from several teams and must determine the winner.
Scoring
There are two components to a team's score. The first is the number of problems solved. The second is penalty points, which reflects the amount of time and incorrect submissions made before the problem is solved. For each problem solved correctly, penalty points are charged equal to the time at which the problem was solved plus 20 minutes for each incorrect submission. No penalty points are added for problems that are never solved.
So if a team solved problem one on their second submission at twenty minutes, they are charged 40 penalty points. If they submit problem 2 three times, but do not solve it, they are charged no penalty points. If they submit problem 3 once and solve it at 120 minutes, they are charged 120 penalty points. Their total score is two problems solved with 160 penalty points.
The winner is the team that solves the most problems. If teams tie for solving the most problems,then the winner is the team with the fewest penalty points.
Input
For the programming contest your program is judging, there are four problems. You are guaranteed that the input will not result in a tie between teams after counting penalty points.
Line 1 < nTeams >
Line 2 - n+1 < Name > < p1Sub > < p1Time > < p2Sub > < p2Time > ... < p4Time >
Line 1 < nTeams >
Line 2 - n+1 < Name > < p1Sub > < p1Time > < p2Sub > < p2Time > ... < p4Time >
The first element on the line is the team name, which contains no whitespace.Following that, for each of the four problems, is the number of times the team submitted a run for that problem and the time at which it was solved correctly (both integers). If a team did not solve a problem, the time will be zero. The number of submissions will be at least one if the problem was solved.
Output
The output consists of a single line listing the name of the team that won, the number of problems they solved, and their penalty points.
Sample Input
4Stars 2 20 5 0 4 190 3 220Rockets 5 180 1 0 2 0 3 100Penguins 1 15 3 120 1 300 4 0Marsupials 9 0 3 100 2 220 3 80
Sample Output
Penguins 3 475
代码
#include <iostream>#include <cstring>#include <string>#include <climits>using namespace std;int main(){int n,sub,time,firstsub,firsttime,i,j,k;string team,firstteam;cin>>n;firstsub=0;firsttime=INT_MAX;while(n--){cin>>team;j=k=0;for(i=0;i<4;i++){cin>>sub>>time;if(time>0){j=j+time+(sub-1)*20;++k;}}/*cout<<team<<" "<<k<<" "<<j<<endl;*/if((k>firstsub) || (k==firstsub && j<firsttime) || 0==i){firstteam=team;firstsub=k;firsttime=j;}}cout<<firstteam<<" "<<firstsub<<" "<<firsttime<<endl;return 0;}
最后贴个图出来
1 0
- POJ 1581 A Contesting Decision
- POJ 1581 A Contesting Decision
- 模拟 POJ-1581 A Contesting Decision
- POJ 1581 A Contesting Decision 水
- A Contesting Decision - 1581
- (DS1.5.4)POJ 1581 A Contesting Decision(结构体排序)
- A Contesting Decision
- ZOJ1764 A Contesting Decision
- A Contesting Decision
- POJ-1581 A Contesting Decision-模拟ACM比赛时的评分规则
- HDU 1304 A Contesting Decision
- A Contesting Decision 简单排序题
- 杭电1304 A Contesting Decision
- 《数据结构编程实验》 1.5.4A Contesting Decision
- 杭电-1304A Contesting Decision(结构体)
- poj1581A Contesting Decision
- Starting From A Decision.
- I have made a decision
- Android OOM全解析
- Mac中Git的简单实用(5) --- Git分支冲突管理
- 灯液未泱-mysql主从部署(二)
- opencv学习笔记3:图像处理
- linux下mysql的root密码忘记解决方
- POJ 1581 A Contesting Decision
- solr5.0集成mmseg4j分词器
- Ubuntu14.04安装openssh-server
- 关于Object-C有关接口方面的应用
- Java (JVM) Memory Model and Garbage Collection Monitoring Tuning
- 欢迎使用CSDN-markdown编辑器
- 找工作_经验01
- DOM
- Java多线程初学者指南系列教程