測試用例
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 "cstring"
#include <stdio.h>
#include "iomanip"
#include "vector"
#include "cmath"
#include "stack"
#include "algorithm"
#include <math.h>
#include "map"
#include "queue"
using namespace std;
int main()
{
int n,h,m,s;
int in=777777777,out=0;
string name,iname,oname;
cin>>n;
while(n--)
{
cin>>name;
scanf("%d:%d:%d",&h,&m,&s);
int t=s+m*60+h*3600;
if(in>t)
{
iname=name;
in=t;
}
scanf("%d:%d:%d",&h,&m,&s);
t=s+m*60+h*3600;
if(out<t)
{
oname=name;
out=t;
}
}
cout<<iname<<" "<<oname;
return 0;
}