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. Haskell语言学习笔记(42)Bifunctor

    Bifunctor class Bifunctor p where bimap :: (a -> b) -> (c -> d) -> p a c -> p b d bim ...

  2. 迷你MVVM框架 avalonjs 学习教程16、过滤器

    avalon的过滤器是参考自angular与rivets.它也被称做管道文本过滤器,它的处理对象只能是文本(字符串),它只能用在文本绑定中,并且只能是双花括号形式.下面是各大家的过滤器比较: rive ...

  3. nginx+redis+4个tomcat 负载均衡

    1,先配置nginx ,如果80接口被占用,且80 的端口又惹不起,参考:https://www.cnblogs.com/xiaohu1218/p/10267602.html 2,下载redis,并配 ...

  4. sqlserver解密加密的存储过程(图解)

    来自博客:http://www.cnblogs.com/wghao/archive/2012/12/30/2837642.html

  5. fm 讲解加代码

    转自: 博客 http://blog.csdn.net/google19890102/article/details/45532745/ github https://github.com/zhaoz ...

  6. jqeury datatable/http://www.cnblogs.com/jobs2/p/3431567.html

    0.http://blog.csdn.net/mickey_miki/article/details/8240477 1.1 修改默认值 代码  841处options 添加分页选择 oInit.bL ...

  7. Electron Browser加载iframe(webview src属性)

    browser或者webcontents 的高度与宽度比例对webview中src的页面结构也是有一定影响的

  8. SpringMVC中ApplicationContext中的配置文件的问题(No bean named 'sessionFactory' is defined 已解决)

    在一个SpringMVC项目中, 连着两天不管怎么搞都是一直在报错, 报的最多的就是一个 Servlet.service() for servlet [springDispatcherServlet] ...

  9. 如何搭建hibernate框架

    我写这篇博客,主要是想让大家能够快速上手hibernate,本人建议学习框架,应该一个框架一个框架学习,别一上手就三大框架整合,学习之类的.这里只是单独搭建hibernate框架,让大家 能够更好的上 ...

  10. VMware Ubuntu 窗口太小 未安装VMwareTools

    安装vmtools就行了:在虚拟机点击重新安装vmtools. 在虚拟机里点开挂载的,将那个压缩文件拉出document,解压 在命令行sudo运行.pl结尾的文件,一路回车就行了. 重启即可.