当前位置:网站首页>1006 Sign In and Sign Out (25分)
1006 Sign In and Sign Out (25分)
2022-08-09 10:48:00 【Cutecumber】
1006 Sign In and Sign Out (25分)
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find the ones who have unlocked and locked the door on that day.
Input Specification:
Each input file contains one test case. Each case contains the records for one day. The case starts with a positive integer M, which is the total number of records, followed by M lines, each in the format:
ID_number Sign_in_time Sign_out_time
where times are given in the format HH:MM:SS
, and ID_number
is a string with no more than 15 characters.
Output Specification:
For each test case, output in one line the ID numbers of the persons who have unlocked and locked the door on that day. The two ID numbers must be separated by one space.
Note: It is guaranteed that the records are consistent. That is, the sign in time must be earlier than the sign out time for each person, and there are no two persons sign in or out at the same moment.
Sample Input:
3
CS301111 15:30:28 17:00:10
SC3021234 08:00:00 11:25:25
CS301133 21:45:00 21:58:40
Sample Output:
SC3021234 CS301133
#include <string>
#include <iostream>
#include <vector>
using namespace std;
vector<string>table[100];
int main(){
int n;
char *pch;
string ID, SignIn, SignOut;
string max = "00:00:0/", min = "25:00:00";
int index_earlist, index_latest;
cin >> n;
for(int i=0; i<n; i++){
cin >> ID >> SignIn >> SignOut;
table[i].push_back(ID);
table[i].push_back(SignIn);
table[i].push_back(SignOut);
}
//找大小
for(int i=0; i<n; i++){
if(table[i][1] < min){
min = table[i][1];
index_earlist = i;
}
if(table[i][2] > max){
max = table[i][2];
index_latest = i;
}
}
cout << table[index_earlist][0] << ' '+table[index_latest][0] << endl;
return 0;
}
边栏推荐
- tensorflow实现线性方程的参数调整
- 情感分析SowNLP词库
- 多商户商城系统功能拆解26讲-平台端分销设置
- The torch. The stack () official explanation, explanation and example
- unix环境编程 第十四章 14.4 I/O多路转接
- Since I use the HiFlow scene connector, I don't have to worry about becoming a "dropper" anymore
- 绝了,这套RESTful API接口设计总结
- tensor.eq() tensor.item() tensor.argmax()
- OpenGL ES2.0编程三部曲(转载自MyArrow)
- How tall is the B+ tree of the MySQL index?
猜你喜欢
Transformer+Embedding+Self-Attention原理详解
性能测试(01)-jmeter元件-线程组、调试取样器
Jmeter BeanShell post processor
jmeter BeanShell 后置处理器
985毕业,工作3年,分享从阿里辞职到了国企的一路辛酸和经验
Oracle数据库常用函数总结
人物 | 从程序员到架构师,我是如何快速成长的?
centos7.5 设置Mysql开机自启动
PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization Paper Reading
机器学习--朴素贝叶斯(Naive Bayes)
随机推荐
【报错记录】解决华擎J3455-ITX不插显示器无法开机的问题
ESIM(Enhanced Sequential Inference Model)- 模型详解
用Word写代码
2022强网杯WP
verbose np.matmul/np.dot/np.multiply/tf.matmul/tf.multiply/*
2022年台湾省矢量数据(点线面)及数字高程数据下载
faster-rcnn learn
力扣(LeetCode)220. 存在重复元素 III(2022.08.08)
华为VRRP+MSTP联动接口检测实验案例
如何在gazebo进行 joint的转动控制
【原创】解决阿里云oss-browser.exe双击没反应打不开,提供一种解决方案
使用pip成功安装某个库,但pycharm中找不到,此问题的解决方案
详细的np.matmul / np.dot / np.multiply / tf.matmul / tf.multiply / *
OpenSSF's open source software risk assessment tool: Scorecards
Create a table in a MySQL database through Doc
pytorch widedeep文档
Solve the ali cloud oss - the original 】 【 exe double-click response can't open, to provide a solution
解决1.tensorflow运行使用CPU不使用GPU 2.tensorflow环境下的GPU版本号 3.tensorflow和cuda以及cudnn版本对应问题 4.查看cuda和cudnn版本
商业技术解决方案与高阶技术专题 - 数据可视化专题
985毕业,工作3年,分享从阿里辞职到了国企的一路辛酸和经验