#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <cstring>
#include <queue>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
struct record
{
char id[20];
int intime;
int outtime;
}A[100010];
int N;
bool cmp1(record a,record b)
{
return a.intime<b.intime;
}
bool cmp2(record a,record b)
{
return a.outtime>b.outtime;
}
int main() {
scanf("%d",&N);
int h,m,s;
for(int i=0;i<N;i++)
{
scanf("%s",&A[i].id);
scanf("%d:%d:%d",&h,&m,&s);
A[i].intime=3600*h+60*m+s;
scanf("%d:%d:%d",&h,&m,&s);
A[i].outtime=3600*h+60*m+s;
}
sort(A,A+N,cmp1);
printf("%s ",A[0].id);
sort(A,A+N,cmp2);
printf("%s",A[0].id);
return 0;
}
PAT甲1006 Sign In and Sign Out (25)(25 分)
猜你喜欢
转载自blog.csdn.net/yhy489275918/article/details/81461821
今日推荐
周排行