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. 【338】Pandas.DataFrame

    Ref: Pandas Tutorial: DataFrames in Python Ref: pandas.DataFrame Ref: Pandas:DataFrame对象的基础操作 Ref: C ...

  2. JavaScipt测试调研

    JavaScript测试调研 前言 与其他语言相似,JavaScript的测试也会包括代码审查.单元测试等内容.本文就JavaScript的测试调研了一些测试工具和测试框架. 相对于其他很多高级语言语 ...

  3. 运行Maven项目时出现invalid LOC header (bad signature)

    为Maven小白,今天这问题困扰了我好久,经过多次在网上查询,终于找到了原因.明明一个小问题却耗费很多时间,着实不应该,所以必须记录一下. 报错信息如下:   对话框: 控制台: <span s ...

  4. referer null

    Referer表示超链接源的URL!你想看到实验效果,要从a-->(能过<a href="b.jsp")b页面,然后在B里可以取得Refere参数! String ur ...

  5. mongodb根据子项中的指标查找最小或最大值

    假设students集合中有这样的数据: { "_id" : 1, "name" : "Aurelia Menendez", "s ...

  6. webdriver简介及浏览器的驱动

     1.webdriver概述:  webdriver(selenium2=selenium1+webdriver)是一种用于web应用程序的自动化测试工具,它提供了一套友好的API,与selenium ...

  7. 关于Application.DoEvents()==转

    记得第一次使用Application.DoEvents()是为了在加载大量数据时能够有一个数据加载的提示,不至于系统出现假死的现象,当时也没有深入的去研究他的原理是怎样的,结果在很多地方都用上了App ...

  8. visual code golang配置

    前言 其实环境搭建没什么难的,但是遇到一些问题,主要是有些网站资源访问不了(如:golang.org), 导致一些包无法安装,最终会导致环境搭建失败,跟据这个教程几步,我们将可以快速的构建golang ...

  9. Swift 项目中可能用到的第三方框架

    这里记录下swift开发中可能用的框架 , 最近浏览了不少,积累在这里,以后用的时候方便查阅.顺便推荐给大家! 这里的框架都是纯swift的 , 感谢开源 ,感谢大神们 . 下拉刷新 BreakOut ...

  10. 4-计算九位数以内各个位数字和为s的种类

    /*假设我们当前要求的是100以内各位数之和和等于s的数有多少个,可以想到就是10以内各位数之和等于s的数的个数再加上10到100内的各位数之和等于s的个数.令dp[i][j]就代表10的j次方内各位 ...