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

FPGA实现Gardner环定时同步:Verilog代码与Testbench实战解析 本文深入解析了在FPGA上实现Gardner环定时同步的完整过程,详细阐述了其非数据辅助的定时误差检测原理。通过Verilog代码实战,展示了内插滤波器、定时误差检测器、环路滤波器和数控振荡器等核心模块的设计,并提供了完整的Testbench验证方法,帮助开发者解决数字通信系统中的时钟同步难题。 阅读详情

题目链接

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;
}


SOMEIP协议--第三节[SOMEIP/SD](SD格式) Entry和Option是SD报文中最重要的内容,是服务发现功能的承载。7.Minor Version是指当前服务的小版本号,可以配置,用于给用户区分当前服务的版本用的。注意:stop offer,stop subscribe,Subscribe Nack 这三条的TTL一定设为0,唯一和offer,subscribe,Subscribe的区别。Option用来辅助Entry实现其功能,是Entry携带的附加信息,作用上一般是用来告诉对端自己业务的ip和port信息,方便对端通过ip和port发送报文。 阅读详情

相关推荐

Figma汉化教程

Figma汉化教程

cc蒲公英的博客 1万+

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

钣金设计高薪进阶:从材料工艺到DFMA降本增效全解析

钣金设计是机械制造领域的核心技术之一,它涉及将金属板材通过切割、折弯、焊接等工艺成型为所需零件。其核心原理在于深刻理解材料特性、制造工艺约束与结构力学,以确保设计在功能、成本与可制造性之间取得最佳平衡。这项技术的价值在于,优秀的钣金设计能直接驱动产品降本增效,通过优化材料利用率、简化装配工序和避免设计缺陷,为企业节省大量模具与生产成本。其应用场景广泛,从机箱机柜、汽车部件到电子设备外壳无处不在。本文将聚焦于实现这一价值的关键路径,深入探讨面向制造与装配的设计(DFMA)原则在钣金领域的实战应用,并剖析如何通

weixin_34301132的博客 391

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

LSTM模型股价波动率预测(含Python代码)

源代码文件可在gzh’finance褪黑素'回复【24012203】获取。

celiaweiwei的博客 3775

全志D1s RISC-V开发板硬件设计与Linux启动全流程解析

RISC-V架构是当前国产嵌入式处理器演进的核心方向,其启动流程涵盖从BootROM、SPL到U-Boot及Linux内核的多级引导机制。理解该流程需掌握DDR初始化、设备树适配、电源时序控制等底层原理,技术价值在于构建可追溯、可调试、可量产的最小可行系统(MVS)。典型应用场景包括边缘AI推理终端、工业HMI和轻量级网关等对成本与开源性敏感的领域。本文以全志D1s平台为载体,深入剖析基于玄铁C906内核的RISC-V SoC在真实硬件上的启动验证、电源完整性设计与Linux全链路开源实践。

weixin_32306683的博客 358

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

数字化车间智能排产调度挑战赛(一)—— 数学模型

科大讯飞——数字化车间智能排产调度挑战赛。

Lyyyp的博客 5649

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的博客 169

SAP CKMLCP 月结7大常见报错:从“未找到成本核算运行”到“物料占用”的完整解决方案

本文深入解析SAP CKMLCP月结过程中的7大常见报错,从权限问题到数据一致性错误,提供系统化的解决方案。重点解决'未找到成本核算运行'和'物料占用'等典型问题,帮助财务人员高效完成成本核算月结,确保数据准确性。

weixin_30299709的博客 416

从零开始搭建一个高性能电流镜:手把手教你设计Wide-Swing Cascode结构

本文详细解析了Wide-Swing Cascode电流镜的设计原理与实战流程。针对低压高性能模拟电路设计的核心挑战,文章手把手指导如何从理论分析、参数计算到仿真验证,搭建一个兼具高输出阻抗和低输出电压裕度的电流镜结构,并深入探讨了偏置电路生成、性能优化及版图匹配等关键要点。

weixin_29294975的博客 625

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

FFMPEG音频开发: Linux下采集摄像头(使用V4L2框架)数据录制成MP4视频保存到本地

一、环境介绍 操作系统介绍:ubuntu 18.04 FFMPEG版本: 4.4.2 摄像头: USB摄像头、虚拟机挂载本机自带摄像头 二、FFMPEG与X264下载编译 X264下载地址: http://www.videolan.org/developers/x264.html FFMPEG下载地址:https://ffmpeg.org/download.html Yasm ...

8872

浙江大学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)~~ 1238

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

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)~~ 1171

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

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

c++实现

~~(v_v)~~ 990

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

浙江大学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)~~ 720

浙江大学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)~~ 705

浙江大学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)~~ 685

浙江大学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、付费专栏及课程。

余额充值