1006 Sign In and Sign Out (25 point(s))

雅思听力词组总结 雅思听力词组总结(涵盖几乎所有雅思真题词组)已更新至1037条 阅读详情

1006 Sign In and Sign Out (25 point(s))

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

 注意点:

1. 表示时间的字符串按照固定格式输入,所以可以直接按照string字符串规则比较;

2. 这道题这样做麻烦了,复杂度o(nlogn),用于按照不同cmp规则排序,实际上在输入的时候比较即可,复杂度o(n)。

#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
struct Record{
	string id_num;
	string in;
	string out;
};
bool cmp1(Record a,Record b){
	return a.in<b.in;
}
bool cmp2(Record a,Record b){
	return a.out<b.out;
}
int main(void){
	int n;
	Record r[1010];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>r[i].id_num>>r[i].in>>r[i].out;
	}
	sort(r,r+n,cmp1);
	cout<<r[0].id_num<<" ";
	sort(r,r+n,cmp2);
	cout<<r[n-1].id_num<<endl;
	return 0;
}

 

【信息科学与工程学】信息工程领域——第三十六篇 电路电子06 电路设计02 覆盖资质、域名、利益、权力、外部关系、品牌形象、财务、账务、销售话术、市场策略、经营策略、产品策略以及人性恶意与善意管理。编号类型领域行业模块管理的内容(定性及定量分析)及管理的频次及周期投入的资源及人力物力和财力及话术和手段和方法关联知识和法律法规1合规法务通用资质维护监控各项资质有效期 Texp​,提前90天启动续期。剩余天数 D=Texp​−Tcurrent​,若 D<90则触发预警。续期成功率 Prenew​=总要求项准备完成项​×(1−e−k⋅投入时间)。频次:每周检查一次。人力:1名法务专员;物 阅读详情

相关推荐

【信息科学与工程学】计算机科学与技术——第七十七篇 系统架构设计02

编号类型模型配方企业资本运作的方法/规则/条件/依据及所有的步骤(​风险处理/异常处理/危机应对关联知识法律法规和裁决依据​​由发起人(通常是知名投资人、投行或产业资本)先设立一个只有现金、无实际业务的特殊目的收购公司(SPAC),通过IPO募集资金并在交易所上市。然后在规定时间内(通常24个月)寻找一家非上市公司进行合并(De-SPAC),使目标公司迅速实现上市,规避传统IPO的复杂流程和不确定性。1.:在开曼或特拉华注册空壳公司,注入少量种子资金。2.

weixin_49199313的博客 317

1006 Sign In and Sign Out (25 point(s))

题解 水题。 #include&lt;iostream&gt; #include&lt;string&gt; #include&lt;cstdio&gt; using namespace std; const int INF = 0x3f3f3f3f; string earliestId, latestId, id; int m, inTime, outTime, inEarliest,...

徐伯莱 213

SAP子公司财务账套配置实战:从公司代码到记账期间变式的关键步骤

本文详细介绍了为SAP子公司快速配置财务账套的实战步骤。通过复用母公司成熟配置,重点阐述了从创建公司代码、关联控制范围到分配记账期间变式的核心流程,帮助顾问在一两个小时内完成核心骨架搭建,实现高效集团财务管控。

cake8的博客 167

A1006 Sign In and Sign Out (25point(s))

A1006 Sign In and Sign Out (25point(s)) #include<cstdio> #include<algorithm> using namespace std; const int maxm = 1000; int M; struct Node{ char ID[20]; int InTime; int OutTime; } n...

LEOSATA's Blog 1173

基于Meteoinfo与TrajStat的后向轨迹聚类分析实战:从数据准备到可视化制图

本文详细介绍了基于Meteoinfo与TrajStat进行后向轨迹聚类分析的完整实战流程。从Java环境配置、Meteoinfo软件与TrajStat插件安装,到精准获取NOAA气象数据、设置参数进行批量轨迹计算,再到利用聚类分析提炼主要气流路径,并最终完成专业地图可视化与制图。文章旨在帮助环境与气象研究者快速掌握从数据准备到成果输出的全链路操作。

p4q5r6s7t的博客 805

RK3568嵌入式Linux多屏显示开发指南

摘要:本篇RK3568嵌入式Linux多屏显示开发指南详细介绍了基于Qt应用层的实现方案。文章首先概述了技术架构,说明从Qt应用到硬件显示的完整流程。然后提供了两种实现方案:推荐使用Qt内置多屏支持方案,包含完整的C++代码示例和配置文件说明;对于需要精细控制的场景,给出了基于libdrm API的底层实现方案。最后重点讨论了屏幕旋转处理和多屏协同工作模式的关键技术要点,包括扩展桌面、镜像模式等实现方法。

froxy的专栏 1574

1006 Sign In and Sign Out (25 point(s))

判断大小

Bonstoppo 316

pgAdmin4备份恢复实战:从安装到避坑指南

本文提供了一份详尽的pgAdmin4备份恢复实战指南,涵盖从安装配置到执行备份恢复的全流程。针对Windows环境下的浏览器兼容性、二进制路径配置等常见问题,给出了具体解决方案。重点强调了使用pgAdmin4进行备份恢复的可靠性,特别是在处理包含PostGIS等扩展的数据库时,能有效避免数据类型和权限错误,确保数据迁移的完整性与安全性。

weixin_29266007的博客 439

1006 Sign In and Sign Out (25point(s))

1006 Sign In and Sign Out (25point(s)) 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

佳迪斯的博客 150

Sigrity System Explorer Transient Analysis模式进行瞬态仿真分析操作指导-单端信号

Sigrity System Explorer Transient Analysis模式可以用于瞬态仿真分析,通过搭建简易拓扑用于前仿真分析通道的时域性能,下面搭建一个简易的单端拓扑进行说明,以下图为例,准备好发送接收端的IBIS模型, (ibis_se.ibs,本例发送接收端都使用相同的IBIS模型),以及传输线的S参数模型(welement_se.sp)最上方的图形界面是传输线的模型,本例是一个上下都有参考平面的带状线,右侧的梯形是蚀刻角度,根据W1和W2以及铜厚来确定。

weixin_54787054的博客 419

大数据ZooKeeper(一):ZooKeeper基本知识

Zookeeper是一个分布式协调服务的开源框架。主要用来解决分布式集群中应用系统的一致性问题。ZooKeeper本质上是一个。

Lansonli(蓝深李)的博客 3150

1006 Sign In and Sign Out (25)(25 point(s))

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...

学习为主,偶尔扯淡 217

深度学习100例-卷积神经网络(CNN)彩色图片分类 | 第2天

文章目录前期工作设置GPU导入数据标准化可视化构建CNN网络编译训练模型预测模型评估 前期工作 设置GPU 如果使用的是CPU可以忽略这步 import tensorflow as tf gpus = tf.config.list_physical_devices("GPU") if gpus: gpu0 = gpus[0] #如果有多个GPU,仅使用第0个GPU tf.config.experimental.set_memory_growth(gpu0, True) #设置GPU显存用量

“365天深度学习训练营”报名进行中~ 7855

PAT(甲级)1006 Sign In and Sign Out (25point(s))

题目 题目链接 思路 这道题写的比较多了,主要是想复习一下类的知识,发现好多知识点忘记了;后来想了想其实可以直接比较子字符串大小,不需要转为int 比较 知识点 1. 首先是类的构造函数,c++中类如果你自己写了构造函数,必须要写一个无参的构造函数,否则编译错误;如果自己不写,系统默认帮你构造;而Java却不需要一定要有无参构造函数,我想可能是因为每次都需要new 一下吧 还有,c++类后的大括号...

hjyp的博客 154

Auto.js实现视频号点赞自动化

摘要:本文介绍了一个微信视频号自动化点赞的实现方案。通过定位点赞图标和数量容器,点击点赞按钮后检测点赞数变化,若发现取消点赞则自动补点。核心代码包括:1)获取点赞容器和图标;2)记录点赞前后数量;3)判断是否误取消并补点;4)循环执行点赞和滑动页面操作。该方案解决了滑动页面可能导致误取消点赞的问题,实现了自动化批量点赞功能。文章强调仅供学习参考,提醒勿滥用该技术。

分享前端工程化、AI 应用、Agent 开发与大模型实践! 2575

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

1006 Sign In and Sign Out (25 point(s)) - C语言 PAT 甲级

设计思路: * 把时间转化为以秒为单位,比较输出

有三只土豆 194

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Advanced Level 1006 Sign In and Sign Out (25 point(s))

题目 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

蒟蒻 289

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 point(s))

题目:PAT 甲 1006 题目大意 找出最早签到的人的ID,以及最晚签退的人的ID 解题思路 排序 #include<bits/stdc++.h> using namespace std; struct Node{ string id,start,end; }; bool cmp(const Node &a,const Node &b){ return a.start<b.start; } bool cmp2(const Node &a,con

helloful的博客 117

PAT(A) 1006 Sign In and Sign Out (25 point(s)) C++

int time = hh6060 + mm*60 +ss 记录时间,便于比较 #include<cstdio> #include<iostream> #include<string> using namespace std; struct node{ string id; int time; }; int main(void){ int M; scanf("%d", &M); node unlocked, l

Anpotan的博客 101

1006 Sign In and Sign Out (25 分) java

解题思路: 题意也好理解,我的思路是将每个id的到达时间和离开时间统一转化成秒,再分别用两个map存储一下,同时更新最早到达时间和最迟离开时间,因为题目保证了两个时间都是唯一的,而map刚刚好没有重复的key。数据处理用split函数已经喜闻乐见了。 import java.util.Scanner; import java.util.HashMap; import java.util.Map; public class Main { public static void main(String.

LangWeiXian_的博客 247

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 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 t

shshbdhsjjd的博客 181
上一篇: 1005 Spell It Right (20 point(s))
下一篇: 1011 World Cup Betting (20 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值