#include<iostream>
using namespace std;
int main()
{
int n,count = 0,num,h,m,sumtime=0;
char a;
cin>>n;
while (n--)
{
int time[1001] = {0};
int book[1001] = {0};
while (scanf("%d %c %d:%d",&num,&a,&h,&m))
{
if (num == 0)
break;
book[num]++;
if (a == 'S')
time[num] = h*60+m;
else if (book[num]%2==0 && a == 'E')
{
count++;
time[num] = h*60 + m - time[num];
sumtime +=time[num];
time[num] = 0;
}
}
if (count == 0)
cout<<"0 0"<<endl;
else
cout<<count<<" "<<(int)(1.0*sumtime/count + 0.5)<<endl;
count = 0;
sumtime = 0;
}
return 0;
}
L1-043 阅览室
最新推荐文章于 2025-03-03 15:14:44 发布