浙江大学PAT_甲级_1006. Sign In and Sign Out (25)

海思Hi3516平台集成IMX214 Sensor实战:从I2C调试到VI通路构建 本文详细记录了在海思Hi3516平台上集成索尼IMX214图像传感器的完整实战过程。从硬件I2C通讯调试、驱动层适配,到上层VI通路构建与ISP配置,提供了系统性的排查步骤与代码修改要点,旨在帮助开发者快速打通从Sensor到屏幕的完整视频采集链路,解决集成过程中的常见问题。 阅读详情

题目链接

http://www.patest.cn/contests/pat-a-practise/1006

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
我的c++代码:
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int i,n;//n总人数
	string first_id, last_id;//irst_id第一个到的人, last_id最后走的人
	string first_time="23:59:59", last_time="00:00:01";//first_time最早签到时间,last_time最晚离开时间
	string id; //普通id
	string in_time, out_time;//in_time普通签到时间,out_time普通离开时间
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> id >> in_time >> out_time;
		if (in_time < first_time)
		{
			first_id = id;//记录最早签到的人
			first_time = in_time;//记录最早签到时间
		}
		if (out_time > last_time)
		{
			last_id = id;
			last_time = out_time;
		}
	}
	cout << first_id << ' ' << last_id;
	//system("pause");
	return 0;
}


2026国内Claude Code保姆级教程:安装、避坑、防串台全优化 安装 Claude Code CLI + 切换 npm 国内镜像优先配置固定关闭:自动联网、自动项目扫描VSCode 内置终端直接用,不装多余插件会话隔离+指令约束,彻底解决 Rust、小程序 跨语言串台。 阅读详情

相关推荐

rk3588 Android HDMI IN热插拔解决

1、公司在使用 别的厂商的板卡遇到一个问题,开机我们的app自启就会闪退,后来定位发现是camera 的open出错了,这个问题的出现是因为没有插HDMI IN输入的问题导致的,所以需要对HDMI IN的热插拔进行检测,后面我把这个问题也顺利解决了。下面是我的尝试和使用的解决办法。3、话不多说,我用的是读取系统文件实现的,但是这个方法,需要有status文件的系统读权限,可以修改设备下的/vendor/etc/init/hw/init.rk3588.rc文件修改的权限,这个问题交给自己或者厂家协商解决。

qq_54089476的博客 1928

PAT甲级A1006 】Sign In and Sign Out (25分)(c++)

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 th

小庄同学的博客 181

Gemini国内合规接入指南:API身份链构建与镜像站选型

生成式AI服务接入本质是服务可用性工程,而非单纯网络连通问题。理解大模型API调用原理,关键在于掌握身份认证、权限控制与数据流向三大技术要素。Gemini作为主流多模态模型,其国内可用路径已从‘模拟访问’转向‘能力映射’——聚焦文本生成等核心能力的稳定调用。通过构建七步Google Cloud身份链(含+86实名、国际信用卡核验、Service Account最小权限配置),可实现99.2%高成功率的合规API接入;而教育型、企业型、开发者型三类镜像站则提供差异化过渡方案,均需满足端到端加密、境内CDN托管

weixin_29046035的博客 492

PAT-甲级-1006

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 r

rv0p111 563

leetcode134 加油站

题目如下 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 如果你可以绕环路行驶一周,则返回出发时加油站的编号,否则返回 -1。 说明: 如果题目有解,该答案即为唯一答案。 输入数组均为非空数组,且长度相同。 输...

ayang818 's blog 244

把 LangGraph 当“工作流引擎”用:与传统 BPM 的差异与融合策略

首先,我们来回顾一下有限状态机(FSM)的基本定义——一个 FSM 可以用一个五元组MQΣδq0FMQΣδq0​FQQQ有限状态集合,包含 FSM 所有可能的状态;Σ\SigmaΣ有限输入字母表,包含 FSM 所有可能的输入;δ\deltaδ状态转移函数,定义了 FSM 从当前状态q∈Qq \in Qq∈Q接收输入σ∈Σσ∈Σ后,转移到的下一个状态q′∈Qq' \in Qq′∈Q,即δQ×Σ→QδQ×Σ→Q。

AI 原生应用开发的博客 237

PAT-Apat甲级题1006(python和c++实现)

1006 Sign In and Sign Out 作者 CHEN, Yue 单位 浙江大学 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 s

qq3342560494的博客 848

告别第三方控件!C#实现OPC UA客户端,对接工业设备超简单

C#实现OPC UA客户端无需依赖第三方商业控件,通过快速起步:通过NuGet安装,使用模拟器完成前期开发测试;复用性强:封装通用工具类,支持连接、读写、订阅等核心功能,可直接集成到各类上位机项目;界面友好:通过WinForm绑定工具类,实现可视化操作,适配工业现场人员使用;工业适配:支持安全配置、身份验证,联调步骤清晰,可快速对接西门子、欧姆龙等主流工业设备;稳定性高:具备资源释放、异常处理、线程安全UI更新等特性,满足工业7×24小时运行要求。

这里只有干货:从 Modbus 到 MES,从 YOLO 到工控机部署;65 篇现场排障案例,每篇都写到改哪一行。 1394

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

achcvb的博客 170

姿态传感器/陀螺仪之LSM6DSLTR应用驱动程序设计

* LSM6DSLTR I2C地址(SA0=1) *//* 初始化LSM6DSLTR传感器(加速度计±2g,陀螺仪±250°/s) *//* 加速度计灵敏度 *//* 角速度值(°/s) *//* I2C句柄 *//* 陀螺仪灵敏度 *//* 加速度值(g) *//* 温度值(°C) *//* 设备地址 *//* IF_INC=1: 自动增量地址 *//* 10Hz采样率 *//* 配置I2C1引脚:PB6->SCL, PB7->SDA *//* 转换为实际温度值(°C),参考手册中温度计算公式 */

corlin6688的博客 403

LeRobot 入门教程(七)数据集

LeRobot Dataset v3.0 是机器人学习数据的标准化格式,支持多模态时间序列数据和视频的统一访问。该版本通过基于文件的存储(Parquet/MP4)、关联元数据和Hub原生流式处理等新特性,显著提升了性能并降低了存储开销。文档详细介绍了格式设计、安装使用、数据记录与加载方法,以及从v2.1迁移到v3.0的步骤,特别针对大型数据集(如DROID 1.0.1)的处理提供了SLURM集群移植方案。v3.0通过优化文件组织和元数据管理,实现了更快的加载速度、更高的内存效率和更好的可扩展性。

2506_90492529的博客 2070

PAT甲级 1006 Sign In and Sign Out

GitHub - ZouJiu1/PAT: 浙江大学PAT题目解答内容浙江大学PAT题目解答内容. Contribute to ZouJiu1/PAT development by creating an account on GitHub.https://github.com/ZouJiu1/PAT

邹九的个人博客 93

华为OD机试双机位C卷-魔法收积木 (C/C++/Py/Java/Js/Go)

华为OD机试(机考)双机位C卷 【魔法收积木】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为od - 魔法收积木。

qq_45776114的博客 1950

浙江大学PAT_甲级_1094. The Largest Generation (25)

题目链接:点击打开链接 A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest po

~~(v_v)~~ 1240

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

PAT_甲级_1001. A+B Format (20)

1001. A+B Format (20)   Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input...

~~(v_v)~~ 1172

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

浙江大学PAT_甲级_1005.1005. Spell It Right (20)

c++实现

~~(v_v)~~ 991

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

浙江大学PAT_甲级_1032. Sharing (25)

题目地址:点击打开链接 To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suf

~~(v_v)~~ 778

PAT_甲级_1029. Median (25)

题目链接:点击打开链接   Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16...

~~(v_v)~~ 746

浙江大学PAT_甲级_1035. Password (20)

C++

~~(v_v)~~ 736

浙江大学PAT_甲级_1081. Rational Sum (20)

题目链接:点击打开链接 Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case sta

~~(v_v)~~ 730

浙江大学PAT_甲级_1023. Have Fun with Numbers (20)

python

~~(v_v)~~ 721

浙江大学PAT_甲级_1036. Boys vs Girls (25)

C++

~~(v_v)~~ 715

PAT_甲级_1065. A+B and C (64bit) (20)

题目链接:点击打开链接   Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B &gt; C. Input Specification: The first line of the input gives the positive number of test cases,...

~~(v_v)~~ 706

浙江大学PAT_甲级_1070. Mooncake (25)

题目链接:点击打开链接 Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the regio

~~(v_v)~~ 687

浙江大学PAT_甲级_1028. List Sorting (25)

C++

~~(v_v)~~ 678

浙江大学PAT_甲级_1019. General Palindromic Number (20)

C++ stack vector

~~(v_v)~~ 652
上一篇: PAT_甲级_1001. A+B Format (20)
下一篇: 浙江大学PAT_甲级_1005.1005. Spell It Right (20)
pythontojava
博客等级 码龄12年 84粉丝 140原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址