POJ-1581 A Contesting Decision-模擬ACM比賽時的評分規則
A Contesting Decision
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 2706 | Accepted: 1911 |
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
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
Source
//模擬ACM比賽時的評分規則,找出獲勝的隊伍
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <cmath>
using namespace std;
struct acm
{
string na;
int a,b,c,d,t1,t2,t3,t4,ts,tt;
};
int main()
{
int i,n,win,max1;
cin>>n;
acm a[n];
for(i=0; i<n; ++i)
{
a[i].ts=a[i].tt=0;
cin>>a[i].na>>a[i].a>>a[i].t1>>a[i].b>>a[i].t2>>a[i].c>>a[i].t3>>a[i].d>>a[i].t4;
if(a[i].t1>0)
{
++a[i].ts;
a[i].tt+=(a[i].t1+20*(a[i].a-1));
}
if(a[i].t2>0)
{
++a[i].ts;
a[i].tt+=(a[i].t2+20*(a[i].b-1));
}
if(a[i].t3>0)
{
++a[i].ts;
a[i].tt+=(a[i].t3+20*(a[i].c-1));
}
if(a[i].t4>0)
{
++a[i].ts;
a[i].tt+=(a[i].t4+20*(a[i].d-1));
}
}
max1=a[0].ts;
win=0;
for(i=1; i<n; ++i)
{
if(a[i].ts>max1)
{
max1=a[i].ts;
win=i;
}
if(a[i].ts==max1)
{
if(a[i].tt<a[win].tt)
win=i;
}
}
cout<<a[win].na<<" "<<a[win].ts<<" "<<a[win].tt<<endl;
return 0;
}
相關文章
- 排球比賽計分程式模擬衝刺(sprint)
- 【比賽】CSP提高組模擬1
- 乒乓球比賽計分程式模擬衝刺(Sprint)計劃
- 10.6 模擬賽(NOIP 模擬賽 #9)
- 模擬賽
- 重慶強校模擬賽,提高組堪比省賽
- 【比賽】暑假集訓CSP提高模擬4
- 【比賽】暑假集訓CSP提高模擬3
- 【比賽】暑假集訓CSP提高模擬2
- 【比賽】暑假集訓CSP提高模擬1
- [比賽總結]ACM div3 G 比賽總結ACM
- 模擬實現的星星評分效果詳解
- 模擬比賽-14屆研究生組C++省賽C++
- 5.4 模擬賽
- 8.5 模擬賽
- 8.2 模擬賽
- 9.2 模擬賽
- NOIP模擬賽2
- CSP模擬賽 #39
- CSP模擬賽 #42
- 7月模擬賽
- 9.12 模擬賽
- 10.7 模擬賽
- NZOJ 模擬賽5
- CSP模擬賽#34
- 10.13 模擬賽
- 11.3 模擬賽
- 模擬賽雜題
- NOIP模擬賽 #4
- 校內模擬賽總結,又名掛分日記
- 基於IEEE30電網系統的停電規模評價系統matlab模擬,對比IEEE118,輸出停電規模,潮流分佈和負載率等Matlab負載
- 10.18 模擬賽
- 模擬賽總結(三)
- 暑假模擬賽總結
- 7.13模擬賽總結
- 【bj】模擬賽 7/16
- noip 模擬賽 4 & 3
- 24/8/12 模擬賽