#include <iostream>
#include <string>
using namespace std;
int n, m;
int main()
{
string openPer, closePer;
string openTime, closeTime;
string s1, s2, s3;
cin >> n;
while (n--)
{
cin >> m;
for (int i=0; i<m; i++)
{
// 证件号码 签到时间 签离时间
cin >> s1 >> s2 >> s3;
if (i == 0)
{
openPer = closePer = s1;
openTime = s2;
closeTime = s3;
}
// 有来的更早的
if (s2 < openTime)
{
openPer = s1;
openTime = s2;
}
// 有走的更晚的
if (s3 > closeTime)
{
closePer = s1;
closeTime = s3;
}
}
cout << openPer << " " << closePer << endl;
}
return 0;
}
HDU 1234(水题)
最新推荐文章于 2020-03-30 14:25:57 发布