Automatic Judge

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)

Total Submission(s): 16    Accepted Submission(s): 11

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.
 
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
 

————————————————————————————————————

题意:算罚时

思路:先判断是否已AC,若AC不处理,最后把AC的题罚时加起来

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <cmath>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <functional> using namespace std; #define LL long long
const int INF=0x3f3f3f3f; int n,m;
struct node
{
int sum,flag;
} x[1200]; int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&m);
int id,h,mm;
char ch[20];
memset(x,0,sizeof x);
for(int i=1; i<=m; i++)
{
scanf("%d%d:%d%s",&id,&h,&mm,ch);
if(!strcmp(ch,"AC")&&!x[id].flag) x[id].flag=1,x[id].sum+=60*h+mm;
else if(!x[id].flag) x[id].sum+=20;
}
int cnt=0,ans=0;
for(int i=1001; i<=1000+n; i++)
if(x[i].flag) cnt++,ans+=x[i].sum;
printf("%d %d\n",cnt,ans);
}
return 0;
}

HDU6023 Automatic Judge 2017-05-07 18:30 73人阅读 评论(0) 收藏的更多相关文章

  1. winform 子窗体数据改变刷新父窗体 分类: WinForm 2014-05-06 18:30 246人阅读 评论(0) 收藏

    两种方法实现: 第一种,传时间变量,主窗体要不停的刷新数据,占用资源比较大. 第二种,用this,感觉比较好用,建议用这种方法. 举例: 主窗体命名:FormA; 子窗体命名:FormB; 数据绑定方 ...

  2. c++map的用法 分类: POJ 2015-06-19 18:36 11人阅读 评论(0) 收藏

    c++map的用法 分类: 资料 2012-11-14 21:26 10573人阅读 评论(0) 收藏 举报 最全的c++map的用法 此文是复制来的0.0 1. map最基本的构造函数: map&l ...

  3. [CS]C#操作word 2016-04-17 18:30 1506人阅读 评论(35) 收藏

    最近在做的项目已经改了好几版,最近这一版用到了word,当然不是直接使用word,而是使用第三方的ActiveX控件:dsoframer.ocx,此控件的使用和其他控件的使用流程没有任何区别,接下来介 ...

  4. 第十二届浙江省大学生程序设计大赛-Lunch Time 分类: 比赛 2015-06-26 14:30 5人阅读 评论(0) 收藏

    Lunch Time Time Limit: 2 Seconds Memory Limit: 65536 KB The 999th Zhejiang Provincial Collegiate Pro ...

  5. 移植QT到ZedBoard(制作运行库镜像) 交叉编译 分类: ubuntu shell ZedBoard OpenCV 2014-11-08 18:49 219人阅读 评论(0) 收藏

    制作运行库 由于ubuntu的Qt运行库在/usr/local/Trolltech/Qt-4.7.3/下,由makefile可以看到引用运行库是 INCPATH = -I/usr//mkspecs/d ...

  6. Rebuild my Ubuntu 分类: ubuntu shell 2014-11-08 18:23 193人阅读 评论(0) 收藏

    全盘格式化,重装了Ubuntu和Windows,记录一下重新配置Ubuntu过程. //build-essential sudo apt-get install build-essential sud ...

  7. highgui.h备查 分类: C/C++ OpenCV 2014-11-08 18:11 292人阅读 评论(0) 收藏

    /*M/////////////////////////////////////////////////////////////////////////////////////// // // IMP ...

  8. HDU6026 Deleting Edges 2017-05-07 19:30 38人阅读 评论(0) 收藏

    Deleting Edges                                                                                  Time ...

  9. Pots 分类: 搜索 POJ 2015-08-09 18:38 3人阅读 评论(0) 收藏

    Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11885 Accepted: 5025 Special Judge D ...

随机推荐

  1. How to Pronounce the Word THEM

    How to Pronounce the Word THEM Share Tweet Share Tagged With: THEM Reduction Study the THEM reductio ...

  2. java包 命名规范 [转]

    Java的包名都有小写单词组成,类名首字母大写:包的路径符合所开发的 系统模块的 定义,比如生产对生产,物资对物资,基础类对基础类.以便看了包名就明白是哪个模块,从而直接到对应包里找相应的实现. 由于 ...

  3. es进行curl请求时报错:missing authentication token for REST request

    把host 修改一下即可 ELASTICSEARCH_HOST=http://user:password@URL:port

  4. canvas 移动光速特效-

    http://pan.baidu.com/s/1cHtABO 密码:istl

  5. idea 码云 项目上传

    1.点击导航栏 VCS -> Import into Version Control -> 托管项目到码云 2.输入码云帐号密码,点击login. 3.勾选private,点击托管按钮. ...

  6. ArrayList LinkList比较

    1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构.      2.对于随机访问get和set,ArrayList优于LinkedList,因为ArrayLi ...

  7. 两台Linux之间传文件

    安装sudo apt-get install openssh-client openssh-server 使用scp命令: scp john@~/hallo.h /usr/include 将左边移动到 ...

  8. The valid characters are defined in RFC 7230 and RFC 3986

    网上大都说什么发送格式与协议定义的不兼容,改tomcat版本或改编码之类的. 本人测试的时候换了个浏览器,不用IE就好了 如果坚持用ie,也有解决方式 @参考文章 成功的方法 在请求地址var url ...

  9. Course Schedule课程表12(用Topological Sorting)

    [抄题]: 现在你总共有 n 门课需要选,记为 0 到 n - 1.一些课程在修之前需要先修另外的一些课程,比如要学习课程 0 你需要先学习课程 1 ,表示为[0,1]给定n门课以及他们的先决条件,判 ...

  10. curl: (60) SSL certificate problem: unable to get local issuer certificate 错误

    今天同事做微信管理的项目,请求接口返回如下错误SSL certificate problem: unable to get local issuer certificate. 此问题的出现是由于没有配 ...