#include "bits/stdc++.h"
using namespace std;
int n,a,b,c;
char j,k;
map<int,int>mp;
map<int,bool>mp1;
int main()
{
cin >> n;
while (n--)
{
int ans_sum = 0,ans_cnt=0;
mp.clear();
while (cin >> a >> j >> b >> k >> c && a != 0)
{
if(j == 'S' ){
mp1[a] = true;
mp[a] = b*60+c;
}else if(j == 'E' && mp1[a]){
ans_sum += b*60+c-mp[a];
mp[a]=0;
ans_cnt++;
mp1[a] = false;
}
}
if(ans_cnt == 0){
printf("0 0\n");
}else{
double k = ans_sum*1.0/ans_cnt;
printf("%d %.0f\n",ans_cnt,k);
}
}
return 0;
}
阅览室 (pta)
最新推荐文章于 2024-03-02 22:02:43 发布