1006 Sign In and Sign Out (25分)(一个字短!)

Windows系统3D Gaussian Splatting环境搭建全攻略:从零开始到成功运行 本文详细介绍了在Windows系统上搭建3D Gaussian Splatting环境的完整流程,包括CUDA 12.6安装、Anaconda环境配置、代码获取与依赖安装等关键步骤。针对Windows平台特有的环境配置问题,提供了实用的解决方案和常见错误排查方法,帮助开发者快速实现3D Gaussian Splatting的成功运行。 阅读详情

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

题意

输出最早登录和最晚登出的id

分析

输入同时记录当前为止最早的登录id和最晚的登出id

代码

#include<iostream>
#include<string>
using namespace std;
int main() {
 	string str, strfi, strlo;
 	int fi1 = 24 * 60 * 60, lo1 = 0;
 	int n;
 	cin >> n;
 	cin.get();
 	for (; n > 0;n--) {
  		getline(cin, str);
  		int k1 = 0, k2 = 0;
  		for (k1 = 0; k1 < str.size(); k1++)
   			if (str[k1] == ' ')
    		break;
  		for (k2 = k1 + 1; k2 < str.size(); k2++)
   		if (str[k2] == ' ')
    		break;
  		int fi = 3600 * ((str[k1 + 1] - '0') * 10 + (str[k1 + 2] - '0')) + 60 * ((str[k1 + 4] - '0') * 10 + (str[k1 + 5] - '0')) + ((str[k1 + 7] - '0') * 10 + (str[k1 + 8] - '0'));
  		int lo = 3600 * ((str[k2 + 1] - '0') * 10 + (str[k2 + 2] - '0')) + 60 * ((str[k2 + 4] - '0') * 10 + (str[k2 + 5] - '0')) + ((str[k2 + 7] - '0') * 10 + (str[k2 + 8] - '0'));
  		if (fi < fi1) {
   			fi1 = fi;
   			strfi = str.substr(0, k1);
  		}
  		if (lo > lo1) {
  	 		lo1 = lo;
   			strlo = str.substr(0, k1);
  		}
 	}
 	cout << strfi << ' ' << strlo;
 	return 0;
}
【数字孪生与仿真技术】06:航天器系统建模与验证全流程实战:从多学科建模到数字孪生(附完整代码与工业案例) 摘要:航天器系统开发面临多学科耦合强、验证流程复杂、可靠性要求极高的挑战。本文基于MATLAB/Simulink平台,系统阐述航天器从多域建模、动力系统开发到任务验证的全流程技术框架。内容涵盖Modelica统一建模规范、光伏-电池联合供电系统仿真、基于模型的需求追溯方法、蒙特卡洛可靠性分析及硬件在环测试等核心技术,并结合James Webb太空望远镜电力系统案例,展示工业级应用实践。文中提供完整的Simulink模型代码、仿真结果及流程图,最后探讨数字孪生与AI增强技术在航天器在轨运维中的未来应用。 阅读详情

相关推荐

SAP生产版本导入避坑大全:从‘黄灯’到‘绿灯’,详解CM_FV_MKAL_CONSISTENCY_CHECK检查函数

本文深入解析SAP生产版本导入过程中的常见问题,特别是通过`CM_FV_MKAL_CONSISTENCY_CHECK`检查函数从‘黄灯’异常到‘绿灯’正常的修复方法。涵盖静态与动态校验机制、典型异常场景诊断及批量导入最佳实践,帮助SAP运维人员高效解决生产版本管理难题。

weixin_30568591的博客 389

PAT甲级 1006 Sign In and Sign Out (25 分)

1006 Sign In and Sign Out (25 分) 题目链接:PAT A 1006 思路分析:这一题也很直接,就是找到开门的(第一个来的)和锁门的(最后一个走的)。利用字符串string是最方便的,因为string比较大小的规则是直接利用字母序。定义unlock,lock,unlocker,locker分别记录开门时间,锁门时间,开门的人,锁门的人。初始先将unlock定义为一天...

weixin_43684054的博客 224

Xiaojie雷达之路---毫米波雷达基础知识---角度估计

本篇文章主要介绍毫米波雷达的基础知识中的角度估计,对于本篇文章主要回答5个问题 1.在雷达的前方,如何估计前方一个物体的角度 2.角度测量的准确性 3.如何测量多个物体的角度 4.雷达可测的角度的视场最大值为多少 5.角度分辨率取决于什么因素 文章目录估计雷达前面一个物体的角度角度测量的准确性雷达的最大角视场测量雷达前方多个距离和速度相同的物体角度分辨率角度估计的流程 估计雷达前面一个物体的角度 估计一个物体的角度,最少需要两根接收天线 发射天线发送一个chirp,经过物体发射后信号,信号分别被第一根天

XiaoJie的博客 1万+

PAT (Advanced Level) 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 u

小楼一夜听春雨 384

abaqus 6.13安装(ubuntu 16.04LTS)

1。从iso将文件拷贝出来 2。chmod 777 -R ./* 给文件权限 3。sudo /home/xx/A/setup 4。安装licenseserver 5。拷贝lic,log文件 6。打开license sudo ./lmgrd -c path 7. 27011@xx or 27011@localhost ...

a1099313374的博客 1950

避坑指南:STM32F4的ADC采样FSR传感器,如何稳定读数并校准压力值?

本文详细解析了STM32F4的ADC采样FSR薄膜压力传感器时遇到的读数不稳定和非线性校准问题,提供了从硬件配置到软件滤波的完整解决方案。通过优化ADC设置、改进滤波算法和实施分段线性校准,帮助工程师实现高精度压力测量,特别适用于智能手套和医疗监测等应用场景。

weixin_28675839的博客 273

1006. Sign In and Sign Out

//1006. Sign In and Sign Out //字符串的比较:string a,b;可以直接比较大小,不需要写重载函数, #include #include using namespace std; int main() { int M; string ID_number, Sign_in_time, Sign_out_time; cin>>M; cin>>ID_num

波大菜菜 936

硬件开发流程

研发流程在一个有一定规模的企业中起到了非常重要的作用,也是一个产品或者项目成功量产出货依赖的平台体系,作为工程师如果想要走的更远,就必须了解流程体系,了解如何对产品的开发质量进行更好的管控。...

weixin_44126796的博客 8384

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

还有很长很长的路 664

Qlib数据获取避坑指南:从CSV导入到自定义数据源的完整解决方案

本文详细解析了Qlib数据获取的完整解决方案,从CSV导入到自定义数据源,涵盖了股票数据处理的关键技巧和常见陷阱。特别针对Qlib平台的数据格式要求和复权处理提供了实用指南,帮助量化投资者高效整合Wind等第三方数据源,确保数据质量与模型性能。

weixin_29047919的博客 305

YOLOv11损失函数进阶:融合SmoothL1与FocalLoss,让检测精度再涨10%的实战教程

在YOLOv11的这里的beta参数控制“L1与L2的过渡阈值”,默认设为1.0即可兼容多数场景。同样在# 计算动态alpha(基于类别样本数,需提前统计self.class_counts)# 交叉熵基础# FocalLoss权重else:使用前需统计数据集的(每个类别的样本数),并传入的alpha参数。损失函数是YOLOv11精度的“灵魂”——SmoothL1让边界框回归“稳、准、狠”,改进FocalLoss让类别分类“雨露均沾”。从代码改造到实战落地,本教程已为你搭建了一条精度跃升的路径。

m0_64661770的博客 213

【PAT(甲级)】1006 Sign In and Sign Out

【PAT(甲级)】1006 Sign In and Sign Out 易错点,思路解答,代码里附有详细的说明

weixin_55202895的博客 458

机器学习之多种算法优缺点总结及优化方法

一、无监督算法: 1、聚类算法:Kmeans 2、关联规则算法:Apriori 二、有监督算法 1、分类算法 决策树(Decision Tree) 支持向量机(SVM) K近邻(kNN,k-NearestNeighbor) 朴素贝叶斯 逻辑回归 2、回归算法 线性回归 多项式回归 3、集成算法 a、bagging(Bootstrapped Aggregation) 随机森林 ...

平原的博客 7081

PAT练习题(甲级) 1006 Sign In and Sign Out (25分)(Java实现)

PAT练习题 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

CoderHqf的博客 9694

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

精雕软件(JDpaint) 5.5 绿色版

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

1006 Sign In and Sign Out (25 分)

#include <iostream> #include <string> using namespace std; typedef struct Person{ string ID=""; string sign_in=""; string sign_out=""; }*Records; int main() { int num_of_pe...

自己人的博客 235

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

1006 Sign In and Sign Out

分数 25全屏浏览切换布局作者 CHEN, Yue单位 浙江大学3。

m0_75262437的博客 933

VB摄像头监控

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

1006 Sign In and Sign Out (25 分)

1006Sign 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 reco...

~ 649

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

cp0328的博客 3382

【PAT甲级】1006 Sign In and Sign Out (25 分)

Sign In and Sign Out 题目描述 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 s...

初见还是重逢的博客 355

1006 Sign In and Sign Out (25分)

PAT甲级1006 Sign In and Sign Out (25分) 题目: 题目分析:这是一道比较简单的查找题,由于是同一天的进进出出,所以只要比较‘进’的最小时间与‘出’的最大时间即可,定义一个people结构体,算出进与出的时间并且记录他们的id,最后输出最小时间与最大时间的id即可~~~~ AC代码附上: #include <iostream> #include <c...

weixin_43795683的博客 350

1006 Sign In and Sign Out (25 分)

问题描述:给定一些车子的入站出站的时间,输出最早进站和最晚出站的车子。 解题思路:只需保留最早和最晚的车子信息,并动态更新,每输入一个就进行比较, AC代码: /*1006 Sign In and Sign Out (25 分) *只需保留最早和最晚的车子信息,并动态更新,每输入一个就进行比较, */ #include&lt;iostream&gt; #include&lt;cstri...

lianwaiyuwusheng的博客 1437

PTA 甲级1006 Sign In and Sign Out

PTA 甲级1006 Sign In and Sign Out (25分) 文章目录PTA 甲级**1006** **Sign In and Sign Out** **(25**分)Input Specification:Output Specification:Sample Input:Sample Output:生词关键句子注意点 题目原文 At the beginning of every ...

Huangpengyu123的博客 289

PAT 甲级 1006 Sign In and Sign Out (25 分)

题目:PAT 甲级 1006 Sign In and Sign Out (25 分) 经验总结: 1、使用结构体存储某人的id和时间。 2、建立两个数组,一个用于存储某人sign in的时间,另一个数组用于存储某人sign out的时间。 3、自定义sort的排序方式(以时间从早到晚排序),对上述两个数组排序。 4、输出排序后的id。 C++代码: #include<bits/std...

努力努力再努力 309

PAT甲级 1006 Sign In and Sign Out

PAT甲级 1006 Sign In and Sign Out 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 record...

旺崽的博客 2954

PAT A1006 Sign In and Sign Out

本程序为PAT A1006 Sign In and Sign Out答案,题目链接。 主体思想:建立一个结构体,存储ID账号,Sign_in时间,Sign_out时间。 详细介绍:   由于时间的输入格式为HH:MM:SS,先将之存为字符串string类型,在依次读取出HH,MM,SS,然后将其转化为整数形式进行加和,加和结果为HHMMSS。这样做的目的时,可以通过比较整数形HHMMSS的大...

weixin_30682415的博客 105

1006 Sign In and Sign Out (25)(25 分)

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

aboc43983的博客 162
上一篇: 1005 Spell It Right (20分)(一个字短!)
下一篇: 1007 Maximum Subsequence Sum (25分)(一个字短!)
大了七八个
博客等级 码龄8年 2粉丝 30原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值