注意:
只有当题目ac了才算罚时。(小心别读错题意)
#include <cstdio>
#include <iostream>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
int v[13];
int ttemp[13];
char s[200];
int main(){
int t;
cin>>t;
int n,m;
int hh,mm;
int cnt,ans;
while(t--){
cnt = 0,ans = 0;
scanf("%d%d",&n,&m);
memset(v,0,sizeof(v));
memset(ttemp,0,sizeof(ttemp));
int temp;
for(int i = 1;i <= m;i++){
scanf("%d %d:%d %s",&temp,&hh,&mm,s);
if(v[temp-1001] == 0){
if(s[0] == 'A'&&s[1] == 'C'){
ans += hh*60+mm;
ans += ttemp[temp-1001];
cnt++;
v[temp-1001] = 1;
}
else{
ttemp[temp-1001] += 20;
}
}
}
printf("%d %d\n",cnt,ans);
}
return 0;
}