pat1006
来源:互联网 发布:厦门大学网络教育报名 编辑:程序博客网 时间:2024/05/17 14:27
#include<cstdio>#include<string>using namespace std;const int maxn=20;string first_id,last_id;int first_time,last_time;int convert(string str){ int num=0; num+=((str[0]-'0')*10+str[1]-'1')*3600; num+=((str[0]-'3')*10+str[1]-'4')*60; num+=((str[0]-'6')*10+str[1]-'7'); return num;}int main(){ int M; char id[maxn],in[maxn],out[maxn]; while(scanf("%d",&M)==1){ scanf("%s%s%s",id,in,out); last_id=first_id=id; first_time=convert(in); last_time=convert(out); for(int i=1;i<M;i++){ scanf("%s%s%s",id,in,out); if(first_time>convert(in)){ first_id=id; first_time=convert(in); } if(last_time<convert(out)){ last_id=id; last_time=convert(out); } } printf("%s %s\n",first_id.c_str(),last_id.c_str()); } return 0;}
阅读全文
0 0
- PAT1006
- pat1006
- pat1006
- PAT1006
- pat1006
- PAT1006(A)
- PAT1006题解
- PAT1006.换个格式输出
- PAT1006 数组打印的问题
- pat1006 Sign In and Sign Out
- PAT1006. Sign In and Sign Out
- PAT1006. Sign In and Sign Out (25)
- PAT1006:换个格式输出整数
- pat1006 Sign In and Sign Out
- PAT1006 换个格式输出整数 (15)
- PAT1006 换个格式输出整数
- PAT1006. 换个格式输出整数
- pat1006:换个格式输出整数
- 最大长方形。
- 实战6.SparkSQL(上)--SparkSQL简介
- 面试-框架-springmvc
- pat1004
- pat1005
- pat1006
- Myeclipse运行程序时出现Console没有输出信息(只有<terminate>...)解决方法
- pat1007
- 深入理解Django中的ORM数据库操作(Django系列1)
- pat1008
- python依赖注入
- iOS【webView 加载微信文章注入JS实现交互 浏览图片及保存】
- pat1014
- rabin-karp 算法学习心得-lintcode 594