请根据记录找出当天开门和关门的人。
Sample Input:
3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40Sample Output:
SC3021234 CS301133
#include <iostream>
#include <string>
using namespace std;
int main()
{
int M;
cin>>M;
int Entertime = -1;
int Leavetime = -1;
string EnterID,LeaveID;
while (M--)
{
string str;
int t1,t2,t3,t4,t5,t6;
char c;
cin>>str>>t1>>c>>t2>>c>>t3>>t4>>c>>t5>>c>>t6;
int time1 = t1*3600 + t2*60 + t3;
int time2 = t4*3600 + t5*60 + t6;
if (time1 < Entertime || Entertime == -1)
{
EnterID = str;
Entertime = time1;
}
if (time2 > Leavetime || Leavetime == -1)
{
LeaveID = str;
Leavetime = time2;
}
}
cout<<EnterID<<" "<<LeaveID;
return 0;
}