博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
九度oj1013
阅读量:2353 次
发布时间:2019-05-10

本文共 963 字,大约阅读时间需要 3 分钟。

这题充分体现了string的方便

#include
using namespace std;#include
int main(){    int n, m;    string t1, t2, t3, t4;    string ptr1, ptr2, ptr3;    while(cin >> n)    {        for(int i = 1; i <= n; i++)        {            cin >> m;            cin >> ptr1 >> t1 >> t2;            ptr2 = ptr1;//开门人证件            ptr3 = ptr1;//关门人证件            t3 = t1;//永远保存最早时间            t4 = t2;//保存最晚时间            for(int j = 2; j <= m; j++)            {                cin >> ptr1 >> t1 >> t2;                                 if(t1 < t3)                     t3 = t1, ptr2 = ptr1;                if(t2 > t4)                    t4 = t2, ptr3 = ptr1;            }            cout << ptr2 << ' ' << ptr3 << endl;        }     }    return 0;}/**************************************************************    Problem: 1013    User: true14fans    Language: C++    Result: Accepted    Time:0 ms    Memory:1520 kb****************************************************************/

转载地址:http://jjwtb.baihongyu.com/

你可能感兴趣的文章
Elasticsearch 7.x生产配置
查看>>
AccessDeniedException: /opt/elasticsearch-7.0.0/config/elasticsearch.keystore
查看>>
bootstrap-table 父子表 联动表 完整例子
查看>>
Spring Cloud 2.x完整入门Demo样例(Greenwich版本)
查看>>
Spring Cloud 2.x学习笔记:2、feign改进(Greenwich版本)
查看>>
SpringCloud 2.x学习笔记:3、Hystrix(Greenwich版本)
查看>>
SpringCloud 2.x学习笔记:4、Zuul(Greenwich版本)
查看>>
ajax提交JSON数组及Springboot接收转换为list类
查看>>
SpringCloud 2.x学习笔记:5、Config(Greenwich版本)
查看>>
RabbitMQ安装、配置与入门
查看>>
Java异常
查看>>
Ibatis代码自动生成工具
查看>>
ant build.xml教程详解
查看>>
彻底理解ThreadLocal
查看>>
localhost与127.0.0.1的区别
查看>>
windows下的host文件在哪里,有什么作用?
查看>>
【工具】人脸识别比对开放平台汇总
查看>>
基于DirectUI技术开发的发卡系统
查看>>
STM32 HAL库、标准外设库、LL库(STM32 Embedded Software)
查看>>
51和AVR单片机
查看>>