PAT 1006 Sign In and Sign Out 查找元素
Input Specification:
Output Specification:
Sample Input:
Sample Output:
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
using namespace std;
int main()
{
int k,h,m,s;
int i,in_time,out_time;
int maxs=,mins=0x7fffffff;
string str,unlock,lock;
cin>>k;
for(i=; i<k; i++)
{
cin>>str;
scanf("%d:%d:%d",&h,&m,&s);
in_time=h*+m*+s;
scanf("%d:%d:%d",&h,&m,&s);
out_time=h*+m*+s;
if(in_time<mins)
{
mins=in_time;
unlock=str;
}
if(out_time>maxs)
{
maxs=out_time;
lock=str;
}
}
cout<<unlock<<" "<<lock;
return ;
}
PAT 1006 Sign In and Sign Out 查找元素的更多相关文章
- PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642
PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642 题目描述: At the beginning of ever ...
- PAT 甲级 1006 Sign In and Sign Out (25)(25 分)
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- PAT甲 1006. Sign In and Sign Out (25) 2016-09-09 22:55 43人阅读 评论(0) 收藏
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- pat 1006 Sign In and Sign Out(25 分)
1006 Sign In and Sign Out(25 分) At the beginning of every day, the first person who signs in the com ...
- PAT甲级——1006 Sign In and Sign Out
PATA1006 Sign In and Sign Out At the beginning of every day, the first person who signs in the compu ...
- PAT Sign In and Sign Out[非常简单]
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- 1006 Sign In and Sign Out (25 分)
1006 Sign In and Sign Out (25 分) At the beginning of every day, the first person who signs in the co ...
- 1006 Sign In and Sign Out (25)(25 分)思路:普通的时间比较题。。。
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- PTA (Advanced Level) 1006 Sign In and Sign Out
Sign In and Sign Out At the beginning of every day, the first person who signs in the computer room ...
- PAT/查找元素习题集
B1004. 成绩排名 (20) Description: 读入n名学生的姓名.学号.成绩,分别输出成绩最高和成绩最低学生的姓名和学号. Input: 每个测试输入包含1个测试用例,格式为: 第1行: ...
随机推荐
- this的绑定(四种绑定)+ 箭头函数 的this
一.this的默认绑定 当一个函数没有明确的调用对象的时候,也就是单纯作为独立函数调用的时候,将对函数的this使用默认绑定:绑定到全局的window对象 例子1: function foo(){ c ...
- composer入门 一些简单常用的命令介绍
composer是什么 composer是PHP的插件依赖管理工具,我个人感觉和java的Maven.Gradle很类似. Windows OS下安装composer 参考: https://www. ...
- Android 菜单 使用XML
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to th ...
- 《Hands-On System Programming with Go》之写文件的代码模板
使用了buffer,这个神奇东东. var w io.WriteCloser // initialise writer defer w.Close() b := bufio.NewWriter(w) ...
- Java之缓冲流(字节/字符缓冲流)
概述 缓冲流,也叫高效流,是对4个基本的 FileXxx 流的增强,所以也是4个流,按照数据类型分类: 字节缓冲流: BufferedInputStream , BufferedOutputStrea ...
- swoole加密可破解吗
程序的执行和加解密过程合二唯一,无论是内部开发人员和外部黑客攻击,即使拿到了数据和私钥和服务器的root权限,也无法解密还原数据. Swoole将加解密分成了3部分(程序+算法+私钥),缺一不可解密. ...
- Java之封装与访问权限控制(一)
目录 Java之封装与访问权限控制(一) 封装的概念 访问控制符 属性私有化 Java之封装与访问权限控制(一) 对于封装的概念,我总觉得自己还是挺了解的,但是真要我说,还真说不出个啥来.我只能默默地 ...
- jQuery基础之事件处理
jQuery基础之事件处理方法,如下图: 代码实现: <script src="JS/jquery-1.12.4.min.js"></script> < ...
- 从零开始的vue学习笔记(三)
事件处理 v-on 指令监听 DOM 事件,并在触发时运行一些 JavaScript 代码,示例: <div id="example-2"> <!-- `gree ...
- asp.net core的AOP记录
序曲:学习编程最好的方式就是敲代码,没有比这个更好的方法,哪怕你看了上百G的视频,都不如你自己敲几行代码更为有效.还有要记得敲完代码然后写一篇随笔来记录一下你所学所想. 什么叫AOP? AOP面向切面 ...