#include <bits/stdc++.h>
using namespace std;
int main()
{
// ios::sync_with_stdio(false);
int n;
cin >> n;
string in, out;
int tsi = 1e6, tso = -1e6;
string name;
int h, m, s;
int ts;
while (n--)
{
cin >> name;
scanf("%d:%d:%d", &h, &m, &s);
ts = h * 3600 + m * 60 + s;
if (ts < tsi)
{
tsi = ts;
in = name;
}
scanf("%d:%d:%d", &h, &m, &s);
ts = h * 3600 + m * 60 + s;
if (ts > tso)
{
tso = ts;
out = name;
}
}
cout << in << " " << out;
}
PAT(甲) - 1006 Sign In and Sign Out
最新推荐文章于 2022-02-20 10:22:11 发布