当前位置:网站首页>Pat class A - check in and check out
Pat class A - check in and check out
2022-07-24 17:04:00 【Soldier Xiaobai】
Check in and check out
The first person to the computer room is responsible for opening the door every day , The last person to leave the machine room is responsible for locking the door .
Now? , Give everyone's check-in and check-out records , Please find out who opened the door that day and who locked the door .
Input format
The first line contains integers MM, Expressing common ownership MM Personal check-in and check-out records .
Next MM That's ok , The form of each line is as follows :
ID_number Sign_in_time Sign_out_time
Time to HH:MM:SS Form gives ,ID_number Is a length not more than 1515 String .
Output format
All in one line , Output the of the door opener and the door locker ID_number, Separated by a space .
Data range
1≤M≤101≤M≤10,
The data ensures that everyone's check-in time is earlier than the check-out time , And there will be no two people signing in or checking out at the same time .
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 <bits/stdc++.h>
using namespace std;
int main()
{
string op_id, op_time;
string cl_id, cl_time;
int n;
cin >> n;
for(int i = 0; i < n; i ++)
{
string id, in_time, out_time;
cin >> id >> in_time >> out_time;
if(!i || in_time < op_time)
{
op_id = id;
op_time = in_time;
}
if(!i || out_time > cl_time)
{
cl_id = id;
cl_time = out_time;
}
}
cout << op_id << " " << cl_id << endl;
return 0;
}
边栏推荐
- Development dynamics | stonedb 2022 release milestone
- Getting started with arcpy
- 804. Unique Morse code word
- Bring 120W goods in 15 seconds. You can also shoot such a popular video
- Zcmu--5083: number pairs of ly (C language)
- ArcGIS layer annotation display
- Shardingsphere database read / write separation
- GDB online debugging of work notes
- QT generation connection Library
- What are the safe securities companies? I want to buy stocks on my mobile phone
猜你喜欢
![[sequential logic circuit] - counter](/img/a5/c92e0404c6a970a62595bc7a3b68cd.gif)
[sequential logic circuit] - counter

QT graphical interface beginner project - unmanned aerial vehicle group combat simulation

JVM class loading subsystem

Long awaited full platform support - Open Source im project uniapp update of openim

Comparison of array and object merging methods assign, merge, defaults, defaultsdeep in lodash

What is fuzzy theory, foundation and process

1184. Distance between bus stops

内核开发

安全:如何为行人提供更多保护

JSP custom tag library --foreach
随机推荐
AXI协议(2):AXI架构的五个通道和两种事务
The differences of several deletions in SQL
Jing Wei PS tutorial: basic part a
mysql 查询某字段中以逗号分隔的字符串的方法
QT QML virtual keyboard
剑指 Offer 48. 最长不含重复字符的子字符串
Topic 6 - message queue for client communication
我们为什么要推出Getaverse?
MODIS data WGet Download
Live review | wonderful playback of Apache pulsar meetup (including PPT download)
什么是模糊理论,基础,流程
Rare earth Developer Conference | Apache pulsar committee Liu Dezhi shares the way of cloud native technology transformation
JS to implement a promise of promises/a+ specification
CDN(Content Delivery Network)内容分发网络从入门到与实战
I'll teach you how to use NPs to build intranet penetration services. When you go out, you can easily connect your lightweight notebook to your home game console to play remotely
SS-Paper【1】:Fully Convolutional Networks for Semantic Segmentation
Why can't sizeof (ARR) / size (arr[0]) be used to calculate the array length inside the called function?
The third edition of New Horizon College English reading and Writing Tutorial 4 graduation examination site (units 1,2,3,5,6)
JS simulation realizes the principles of call, apply, bind and new
1163: SongGe's score splitting (C language)