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. $Presentation Error (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. $Wrong Answer (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. $Runtime Error (RE)$ : Your program failed during the execution and you will receive the hints for the reasons.

5. $Time Limit Exceeded (TLE)$ : Your program tried to run during too much time.

6. $Memory Limit Exceeded (MLE) $: Your program tried to use more memory than the judge default settings.

7. $Output Limit Exceeded (OLE) $: Your program tried to write too much information. This usually occurs if it goes into a infinite loop.

8. $Compilation Error (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\leq T\leq20)$, denoting the number of test cases. 
In each test case, there are two integers $n(1\leq n\leq 13)$ and $m(1\leq m\leq 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\leq x\leq 1000+n)$ and two strings $t(00:00\leq t\leq 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
 
 
 
题目意思:基本就是ACM比赛的判题机制吧,但是有点不一样的是一道题只有最后AC了,才会增加罚时,没有AC的题不增加罚时
 
上代码:
 
 
 #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
struct messages
{
int id;//题号
int h;//时
int m;//分
char s[];//状态
} a[];
int ac[];//用来标记是否ac过,ac了代表1,不ac代表0
int time[];
int main()
{
int t,n,m,i,sum,count;
scanf("%d",&t);
while(t--)
{
sum=;
count=;
memset(time,,sizeof(time));
memset(ac,,sizeof(ac));
scanf("%d%d",&n,&m);
for(i=; i<m; i++)
{
scanf("%d",&a[i].id);
scanf("%d:%d",&a[i].h,&a[i].m);
scanf(" %s",a[i].s);
if(ac[a[i].id]==)//用来过滤掉那些已经ac的题目
{
continue;
}
if(a[i].s[]=='A')
{
time[a[i].id]+=a[i].h*+a[i].m;
ac[a[i].id]=;
}
else
{
time[a[i].id]+=;
}
getchar();
}
for(i=; i<=+n; i++)//采用了类似哈希的方法
{
if(ac[i])
{
sum+=time[i];
count++;
}
}
printf("%d %d\n",count,sum);
}
return ;
}

Automatic Judge的更多相关文章

  1. HDU6023 Automatic Judge 2017-05-07 18:30 73人阅读 评论(0) 收藏

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

  2. APIPA(Automatic Private IP Addressing,自动专用IP寻址)

    APIPA APIPA(Automatic Private IP Addressing,自动专用IP寻址),是一个DHCP故障转移机制.当DHCP服务器出故障时, APIPA在169.254.0.1到 ...

  3. [SharePoint 2013] Automatic deployment script

    Implement automatic deployment through windows task. Add-PsSnapin Microsoft.SharePoint.PowerShell $t ...

  4. Gym 101102C---Bored Judge(区间最大值)

    题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...

  5. JSONKit does not support Objective-C Automatic Reference Counting(ARC) / ARC forbids Objective-C objects in struct

    当我们在使用JSONKit处理数据时,直接将文件拉进项目往往会报这两个错“JSONKit   does not support Objective-C Automatic Reference Coun ...

  6. iOS开发 JSonKit does not support Objective-C Automatic Reference Counting(ARC)

    有使用JSonKit的朋友,如果遇到“JSonKit does not support Objective-C Automatic Reference Counting(ARC)”这种情况,可参照如下 ...

  7. NOJ 1074 Hey Judge(DFS回溯)

    Problem 1074: Hey Judge Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format: ...

  8. [转]error: 'retainCount' is unavailable: not available in automatic reference counting mode

    转载地址:http://choijing.iteye.com/blog/1860761   后来发现是编译选项的问题:   1.点击工程名 打开编译选项 2.在编译选项中,选择Bulid Settin ...

  9. [转]关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode的解决方法

    转载地址:http://blog.csdn.net/xbl1986/article/details/7216668 Xcode是Version 4.2 Build 4D151a 根据Objective ...

随机推荐

  1. meven 配置

    配置meven 自定义文件[User Settings] D:\java\apache-maven-3.5.3\conf\settings.xml settings.xml 新增两端配置信息 < ...

  2. 关于Vue的组件的通用性问题

    在项目中,经常会有需求让我们把很多通用性的功能写成一个模板,然后根据不同的应用场景传入不同的参数来完成某种功能 但是在很多时候,其实并不是一个模板就能完成所有的功能的 这就需要分类写组件了,但是需求方 ...

  3. 如何解决php无法存储session中的问题?

    场景:前几天在一个技术群里面,看到一个小伙伴提出了一个问题------在thinkphp框架中,使用用户登录将用户信息存储在session,始终是无法存储的. 解决思路:先查看了代码逻辑(确证无误)- ...

  4. CAT 安装运行配置教程

    CAT安装教程 首先安装mysql数据库,具体步骤参阅<mysql免安装教程>--http://www.cnblogs.com/halberts/p/8723938.html 下载CAT代 ...

  5. C语言复合数据类型

           C语言数据类型非常丰富,其中结构体的使用非常广泛,也有一点复杂,这一讲我们主要学习结构体的使用方法,同时也会学习到联合.枚举以及typedef的使用,因为结构体最为复杂,使用最广,所以我 ...

  6. [HDU6326]Monster Hunter(贪心)

    用(a,b)表示一个点先失去a点HP,然后增加b点HP 首先容易证明忽略父亲条件下,任意两个点,先吃b大的最优 对于一个节点v和它的父节点u,若此时选v最优,那么就是吃到u时可以立即吃掉v, 于是可以 ...

  7. JavaWeb——升级赛-学生成绩管理系统(1)jsp---19.01.03

    add.jsp <%@ page language="java" contentType="text/html; charset=UTF-8"    pa ...

  8. Lingo基本操作

    目录 Lingo基本操作 前言 一.Lingo基本运算符 1.1 算术运算符 1.2 逻辑运算符 1.3 关系运算符 二.函数 2.1 标准数学函数 2.2 集循环函数 三.待更新 Lingo基本操作 ...

  9. Apache Tomcat 8.5 安全配置与高并发优化

    通常我们在生产环境中,Tomcat的默认配置显然不能满足我们的产品需求,所以很多时候都需要对Tomcat的配置进行调优,以下综合我自己的经验来配置 Tomcat 安全与优化情况,如果你有更好的方案,请 ...

  10. SpspringBoot日志logback-spring.xml分环境

    SpspringBoot日志logback-spring.xml分环境 2017年08月02日 03:05:13 cqqianyi1 阅读数:30563 标签: logback slf4j sprin ...