hdu1234

/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>

typedef long long LL;
using namespace std;

int n, t;

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);

    scanf("%d", &t);
    while(t--){
        scanf("%d", &n);
        string name, st, ed;
        cin >> name >> st >> ed;
        string ansname1 = name, ansst = st, ansname2 = name, ansed = ed;
        for (int i = 2; i <= n; i++){
            cin >> name >> st >> ed;
            if(ansst > st){
                ansname1 = name;
                ansst = st;
            }
            if(ansed < ed){
                ansed = ed;
                ansname2 = name;
            }
        }
        cout << ansname1 << " " << ansname2 << endl;
    }

    return 0;
}
/**/

 

全部评论

相关推荐

06-15 18:44
黄淮学院 Java
Lynn012:如果是居民楼还是算了吧,看着有点野呢
点赞 评论 收藏
分享
Yki_:你要算时间成本呀,研究生两三年,博士三四年,加起来就五六年了,如果你本科去腾讯干五年,多领五年的年薪,加上公司内涨薪,可能到时候十五年总薪资也跟博士差不多
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务