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. Python 3 学习笔记(1)

    Python 3.6 运算符 + - * / 四则运算 % 求余 **乘方 // 用于整除 字符串 字符串用单引号或双引号括起来. 三引号(单引号或双引号均可)表示多行字符串,行末加反斜杠表示换行不算 ...

  2. Spring 集成Hibernate的三种方式

    首先把hibernate的配置文件hibernate.cfg.xml放入spring的src目录下,并且为了便于测试导入了一个实体类Student.java以及它的Student.hbm.xml文件 ...

  3. Linux下tar.gz 安装

    将安装文件拷贝至你的目录中 如果是以root身份登录上的,就将软件拷贝至/root中. cp xxx.tar.gz /root 解压缩包 tar xvzf xxx.tar.gz 切换到安装目录下 cd ...

  4. 70. Climbing Stairs (Array; DP)

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...

  5. python 网络客户端编程端口,模块

    协议 功能 端口 模块 HTTP 网页 80 httplib,urllib,xmlrpclib NNTP Usenet 新闻组 119 nntplib FTP 文件传输 20(21控制和命令端口) f ...

  6. [leetcode]277. Find the Celebrity谁是名人

    Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist o ...

  7. tomcat执行文件权限

    .当我在linux下某个目录执命令或者安装的时候通常会提示没有权限或者不可以操作,这时需要加权限 chmod /usr/local/tomcat/bin; 2关于LINUX权限(启动tomcat)-b ...

  8. linux下一些常用系统命令

    查看系统打开的文件数 lsof|wc -l 查看当前目录下的文件数 find -type f | wc -l 查看某个目录下的文件数,注意这里/home包括其所有子目录 find /home -typ ...

  9. pthread_exit pthread_join

    int pthread_join(pthread_t thread, void **retval); int pthread_detach(pthread_t thread); void pthrea ...

  10. [freeCodeCamp] solution to JUGGLING ASYNC

    Here's the official solution in case you want to compare notes: var http = require('http') var bl = ...