Automatic Judge
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 848 Accepted Submission(s): 333
Problem Description
Welcome to HDU to take part in the second CCPC girls’ competition!
A new automatic judge system is used for this competition. During the five-hour contest time, you can submit your code to the system, then the judge will reply you. Here is a list of the judge's replies and their meaning:
1. Accepted(AC) : Yes, your program is correct. You did a good job!
2. PresentationError(PE) : Your program's output format is not exactly the same as required by the problem, although the output is correct. This usually means the existence of omitted or extra blank characters (white spaces, tab characters and/or new line characters) between any two non-blank characters, and/or blank lines (a line consisting of only blank characters) between any two non-blank lines. Trailing blank characters at the end of each line and trailing blank lines at the of output are not considered format errors. Check the output for spaces, blank lines, etc. against the problem's output specification.
3. WrongAnswer(WA) : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic :-)
4. RuntimeError(RE) : Your program failed during the execution and you will receive the hints for the reasons.
5. TimeLimitExceeded(TLE) : Your program tried to run during too much time.
6. MemoryLimitExceeded(MLE) : Your program tried to use more memory than the judge default settings.
7. OutputLimitExceeded(OLE) : Your program tried to write too much information. This usually occurs if it goes into a infinite loop.
8. CompilationError(CE) : The compiler fails to compile your program. Warning messages are not considered errors. Click on the judge's reply to see the warning and error messages produced by the compiler.
For each submission, if it is the first time that the judge returns ``AC'' on this problem, then it means you have passed this problem, and the current time will be added to the penalty of your team. In addition, every time you pass a problem, each unsuccessful try for that problem before is counted as 20 minutes penalty, it should also be added to the penalty of your team.
Now given the number of problems in the contest and the submission records of a team. Please write a program to calculate the number of problems the team passed and their penalty.
A new automatic judge system is used for this competition. During the five-hour contest time, you can submit your code to the system, then the judge will reply you. Here is a list of the judge's replies and their meaning:
1. Accepted(AC) : Yes, your program is correct. You did a good job!
2. PresentationError(PE) : Your program's output format is not exactly the same as required by the problem, although the output is correct. This usually means the existence of omitted or extra blank characters (white spaces, tab characters and/or new line characters) between any two non-blank characters, and/or blank lines (a line consisting of only blank characters) between any two non-blank lines. Trailing blank characters at the end of each line and trailing blank lines at the of output are not considered format errors. Check the output for spaces, blank lines, etc. against the problem's output specification.
3. WrongAnswer(WA) : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic :-)
4. RuntimeError(RE) : Your program failed during the execution and you will receive the hints for the reasons.
5. TimeLimitExceeded(TLE) : Your program tried to run during too much time.
6. MemoryLimitExceeded(MLE) : Your program tried to use more memory than the judge default settings.
7. OutputLimitExceeded(OLE) : Your program tried to write too much information. This usually occurs if it goes into a infinite loop.
8. CompilationError(CE) : The compiler fails to compile your program. Warning messages are not considered errors. Click on the judge's reply to see the warning and error messages produced by the compiler.
For each submission, if it is the first time that the judge returns ``AC'' on this problem, then it means you have passed this problem, and the current time will be added to the penalty of your team. In addition, every time you pass a problem, each unsuccessful try for that problem before is counted as 20 minutes penalty, it should also be added to the penalty of your team.
Now given the number of problems in the contest and the submission records of a team. Please write a program to calculate the number of problems the team passed and their penalty.
Input
The first line of the input contains an integer
T(1≤T≤20)
, denoting the number of test cases.
In each test case, there are two integers n(1≤n≤13) and m(1≤m≤100) in the first line, denoting the number of problems and the number of submissions of a team. Problems are labeled by 1001, 1002, ..., 1000+n .
In the following m lines, each line contains an integer x(1001≤x≤1000+n) and two strings t(00:00≤t≤05:00) and s , denoting the team submits problem x at time t , and the result is s . t is in the format of HH:MM, while s is in the set \{AC, PE, WA, RE, TLE, MLE, OLE\}. The team is so cautious that they never submit a CE code. It is guaranteed that all the t in the input is in ascending order and every t is unique.
In each test case, there are two integers n(1≤n≤13) and m(1≤m≤100) in the first line, denoting the number of problems and the number of submissions of a team. Problems are labeled by 1001, 1002, ..., 1000+n .
In the following m lines, each line contains an integer x(1001≤x≤1000+n) and two strings t(00:00≤t≤05:00) and s , denoting the team submits problem x at time t , and the result is s . t is in the format of HH:MM, while s is in the set \{AC, PE, WA, RE, TLE, MLE, OLE\}. The team is so cautious that they never submit a CE code. It is guaranteed that all the t in the input is in ascending order and every t is unique.
Output
For each test case, print a single line containing two integers
A
and
B
, denoting the number of problems the team passed and the penalty.
Sample Input
1 3 5 1002 00:02 AC 1003 00:05 WA 1003 00:06 WA 1003 00:07 AC 1002 04:59 AC
Sample Output
2 49
Source
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6023
题意:给你测试数据数,题目数和提交次数,及每次提交的题目ID,时间和结果,求所用总时间.
计算规则:
若AC了题目,则用AC时时间+之前该题提交非正确次数*20
有个坑,即使一个题目错了1w次,最后没有AC,那些罚时讲不会计算.
思路:用两个数组,一个标记题目是否AC,另一个数组记录AC前不正确提交次数.
AC代码:
/**
* 行有余力,则来刷题!
* 博客链接:http://blog.youkuaiyun.com/hurmishine
*
*/
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn=0;
int main()
{
//freopen("C:\\Documents and Settings\\Administrator\\桌面\\data.txt","r",stdin);
int T;
cin>>T;
int cnt[15];
bool vis[15];
while(T--)
{
int n,m;
int id,hh,mm;
char ch[5];
memset(cnt,0,sizeof(cnt));
memset(vis,false,sizeof(vis));
int sum=0;
int ans=0;
cin>>n>>m;
for(int i=0;i<m;i++)
{
scanf("%d%d:%d%s",&id,&hh,&mm,ch);
id-=1000;
if(ch[0]=='A'&&!vis[id])
{
vis[id]=true;
ans++;
sum+=hh*60+mm+cnt[id]*20;
}
else if(ch[0]!='A'&&!vis[id])
{
cnt[id]++;
}
}
cout<<ans<<" "<<sum<<endl;
}
return 0;
}
剩下题有时间再补
大神题解:http://blog.youkuaiyun.com/snowy_smile/article/details/71305032

本文介绍了一个用于CCPC女子比赛的自动判题系统的运作原理,包括各种反馈代码的意义,并提供了一道典型的问题——如何计算团队通过题目数量及罚时。文中还附带了解决这个问题的AC代码。
3186

被折叠的 条评论
为什么被折叠?



