(HDU 6023 女生专场)Automatic Judge 简单模拟
来源:互联网 发布:鱼8反潜导弹数据 编辑:程序博客网 时间:2024/04/29 03:52
Automatic Judge
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 674 Accepted Submission(s): 272
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:
Accepted(AC): Yes, your program is correct. You did a good job!
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.
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 :-)
RuntimeError(RE) : Your program failed during the execution and you will receive the hints for the reasons.
TimeLimitExceeded(TLE) : Your program tried to run during too much time.
MemoryLimitExceeded(MLE): Your program tried to use more memory than the judge default settings.
OutputLimitExceeded(OLE): Your program tried to write too much information. This usually occurs if it goes into a infinite loop.
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.
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
2017中国大学生程序设计竞赛 - 女生专场
题意:
给你n个题的信息,每个题有三个信息:num t s ,题号,提交的时间,和返回的结果。一道题第一次AC时总时间要加上AC的时间点,每错一次则会在最后的时间上加上20分钟。问你最终的时间为多少?
分析:
就是一道简单的模拟,唯一的错误点就是一道题只有最后AC了,才会增加罚时,没有AC的题不增加罚时
AC代码:
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>using namespace std;bool p[20];int wa[20];int main(){ int T,n,m; int num; char t[10],s[5]; scanf("%d",&T); while(T--) { scanf("%d%d",&n,&m); memset(p,0,sizeof(p)); memset(wa,0,sizeof(wa)); int time = 0; int pass = 0; for(int i=0;i<m;i++) { scanf("%d%s%s",&num,t,s); int numt = num - 1000; if(p[numt]) continue; if(s[0] == 'A') { p[numt] = 1; pass++; time += (t[1]-'0')*60 + (t[3]-'0')*10 + (t[4]-'0'); time += wa[numt] * 20; } else { wa[numt]++; } } printf("%d %d\n",pass,time); } return 0;}
- (HDU 6023 女生专场)Automatic Judge 简单模拟
- HDU 6023 Automatic Judge (模拟)
- HDU6023-Automatic Judge-简单模拟
- HDU 6023 Automatic Judge
- HDU 6023 Automatic Judge
- HDU 6023 Automatic Judge
- HDU 6023 Automatic Judge(水题)
- HDU Automatic Judge
- 2017女生赛 1001 Automatic Judge【】
- 2017CCPC女生赛 Automatic Judge
- (HDU 6024 女生专场)Building Shops 简单DP详细解答
- hdoj 6023 Automatic Judge
- 6023 Automatic Judge
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5702
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5703
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5704
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5705
- "巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5706
- 2017-5-18 实训第四天
- 什么股票复权后股价会很高,有的达万元
- 计算机英语·B
- C#中ToString格式大全(转)
- HDFS命令笔记
- (HDU 6023 女生专场)Automatic Judge 简单模拟
- Docker实战(一):Docker基础命令
- 几何校正,正射校正,影像配准,辐射定标,辐射校正,大气校正,地形校正概念详解
- 堆排序(heap-sort)小结
- 数据结构 — 堆基本概念以及基本操作
- 验证码
- Lucene--Field域和索引维护
- Docker实战(二):制作自己的Docker镜像
- [李景山php] 深入理解PHP内核[读书笔记]--第五章:类和面向对象 --访问控制的实现