英文烂果然是硬伤啊。。。水题都要提交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.

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 >

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

4
Stars 2 20 5 0 4 190 3 220
Rockets 5 180 1 0 2 0 3 100
Penguins 1 15 3 120 1 300 4 0
Marsupials 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;
}

最后贴个图出来

POJ 1581 A Contesting Decision相关推荐

  1. POJ 1581 优先队列 priority_queue -- 比赛胜者求解

    题目链接:http://poj.org/problem?id=1581 题目大意: 给定选手姓名,及答题提交次数(提交正确前,错误一次罚20分),每题的做题时间罚分(未正确作答的不罚分),最后求谁是胜 ...

  2. (精)【ACM刷题之路】POJ题目详细多角度分类及推荐题目

    POJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094) 初期: ...

  3. POJ刷题列表——正在进行

    转载自:http://blog.csdn.net/pyub153/article/details/50480333 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心 ...

  4. POJ前面的题目算法思路【转】

    1000 A+B Problem 送分题 49% 2005-5-7 1001 Exponentiation 高精度 85% 2005-5-7 1002 487-3279 n/a 90% 2005-5- ...

  5. ACM POJ 题目分类(完整整理版本)

    DP: 1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题   ...

  6. POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)

    本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...

  7. hdu与poj题目分类

    POJ 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(po ...

  8. POJ ACM题分类

    初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj329 ...

  9. [POJ题目分类][转]

    Hint:补补基础... 初期: 一.基本算法:      (1)枚举. (poj1753,poj2965)      (2)贪心(poj1328,poj2109,poj2586)      (3)递 ...

  10. 【POJ】POJ题目分类

    转自:http://www.cnblogs.com/kuangbin/archive/2011/07/29/2120667.html 初期: 一.基本算法:      (1)枚举. (poj1753, ...

最新文章

  1. eclipse项目转android studio详解
  2. Intel汇编语言程序设计学习-第三章 汇编语言基础-上
  3. 003_Spring Data JPA分页和排序查询
  4. 加计18-3李元龙第一次作业
  5. ActiveMq消费端实现集群部署
  6. 一个美国老工程师的心理话: 给年轻工程师的十大忠告
  7. 超1亿人选择朋友圈三天可见,背后的原因值得深思
  8. [C++11]shared_ptr共享智能指针的初始化与使用
  9. php无法新数据类型,新手入门PHP必知的七种数据类型
  10. Django中celery配置总结
  11. 软件测试 学习之路 html基础
  12. Unwind 栈回溯详解:libunwind
  13. AlexNet模型解读
  14. 算法导论第三版 16.1-5习题答案
  15. CTFHUBWeb技能树——密码口令writeup 附常见网络平台默认密码
  16. 抖音最近很火的游戏直播:挤地铁教程+源码+软件下载
  17. PCB多层板 : 磁通对消法有效控制EMC
  18. 大型MMO-SNS类游戏服务器架构
  19. 看视频自学Servlet
  20. idea出现Error:Abnormal build process termination:

热门文章

  1. A New Voyage
  2. 流氓与骗子的斗嘴(转)
  3. 什么是单子?Java开发人员的基本理论
  4. Python中pass是什么?
  5. el-upload上传图片,限制上传数量,超过最大数量则不展示上传组件,可点击删除
  6. 历史大盘跌停记录,2016大盘跌停原因
  7. 奇怪的消费者心理:看三个趣味经济学原理
  8. 阿里云服务器入门使用
  9. c语言之数据类型长度
  10. 5分钟搭建3D场景 3D可视化搭建平台WebGLHTML5