PAT(Advanced Level) 1006 - Sign In and Sign Out(水题)

Mac用户必看:PD虚拟机网络初始化失败的3分钟修复指南(附详细截图) 本文针对Mac用户在Parallels Desktop(PD虚拟机)启动时遇到的“网络初始化失败”问题,提供了快速诊断与修复指南。核心原因是macOS系统更新后权限未正确授予。文章通过详细的三步修复法(关闭进程、修改配置文件、重新授权重启),帮助用户在3分钟内恢复虚拟机网络连接,并附有排查清单与预防建议。 阅读详情

*1006. Sign In and Sign Out (25)

时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
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 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

AC代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int start_time = INT_MAX;
    int end_time = -1;
    char start_name[15];
    char end_name[15];
    fflush(stdin);
    while(n--)
    {
        char name[15];
        int s_h,s_m,s_s,e_h,e_m,e_s;
        scanf("%s",name);
        scanf("%d:%d:%d",&s_h,&s_m,&s_s);
        scanf("%d:%d:%d",&e_h,&e_m,&e_s);
        if(start_time > s_h*60*60+s_m*60+s_s)
        {
            start_time = s_h*60*60+s_m*60+s_s;
            strcpy(start_name,name);
        }
        if(end_time < e_h*60*60+e_m*60+e_s)
        {
            end_time = e_h*60*60+e_m*60+e_s;
            strcpy(end_name,name);
        }
    }
    cout<<start_name<<" "<<end_name;
    return 0;
}
win10自动修复-无限循环【通用完美】超简单解决办法 2020.02.14今个我的笔记本电脑(Thinkpad Carbon 7 X1)(win10)早晨起来发现蓝屏,上面显示自动修复失败,重启后依然自动修复失败,不断手动重启,始终是修复失败。然后上网开始搜集资料找解决办法。 前边介绍关闭自动修复,如何找出错文件的方法;如果想看最终解决办法,直接看第三部分 上网就会发现这种现象很常见,同时是电脑自动安装系统更新,或者安装某些驱动出现。解决办法也大... 阅读详情

相关推荐

Ubuntu20.04复现instant-ngp,自建数据集,导出mesh

本次仅仅记录一下自己复现instant-ngp的过程,如果里面的参考有冒犯到原博主请联系我删除,本人也是nerf的小白一枚,可以一起交流学习神经辐射场,希望大家在复现instant-ngp的时候少走一些坑,情况允许下可以去复现一下npg-pl和nerfStudio,最后希望大家一起进步。看到一些博主说葵司的npg_pl也不错,而且葵司是台湾人,在youtube上也有讲解的视频。渲染的效果还是可以的,相对于源码来说还是有点模糊,我一些参数也没有设置,直接就拉进来进行渲染,速度是非常快的。

weixin_59961223的博客 9455

PAT(advanced level) 1006 Sign in and Sign out (水题+字符串处理)

解题思路+技巧 设置一个边界最早时间,和边界最晚时间。每次输入进行更新,同时得到开门人id与关门人id。在比较时间时由于采用的是24小时制,可以直接使用字符串的比较,无需进行处理。 代码 #include <iostream> using namespace std; typedef struct{ string id,login,logout; }user; int main(){...

qq_41970098的博客 314

3DE重客户端安装

3DE重客户端安装

m0_48170265的博客 9499

「PAT甲级真题解析」Advanced Level 1006 Sign In and Sign Out

1. 题目给出一组学生进入机房的进入时间和离开时间, 要求找出最早进入机房开门的人以及最晚离开机房锁门的人. 到这里我们可以看出题目的重点在于查找, 而查找会涉及到数据的存储, 如果存储数据以及在储存的数据中进行查找是我们要考虑的核心。 2. 我们可以存储所有的进入时间和对应的学生ID, 然后比较出最早的进入时间。但我们在乙级的题目练习中多次提到, 数据存储是为了使用, 在这种情况下, 进入时间在进行一次比较之后就不会再用到了, 所以可以不需要存储全部进入时间, 而是直接存储当前最早进入时间然后不断更新。

过美好生活,做高效程序员 5419

copilot基于 DeepSeek-R1 思路构建 VLA 自动驾驶强化学习系统

下面给出一个完整示例代码,结合 DeepSeek‑R1 的技术方法,实现一个端到端的 VLA(视觉+语言行动)自动驾驶深度强化学习系统。.2f。

ywfwyht的博客 779

gdb对dwarf调试信息的解析和使用

gdb的对dwarf的调试信息的解析到使用的过程分析

JS072110的专栏 9573

PAT甲级(Advanced Level) Practice 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 records of signing in's and out's, you are supposed to find the ones who have unlocked and loc

2301_78006009的博客 563

libnice和coturn这两个库有交叉实现的地方,具体有啥区别?

TurnAdmin:是一个TURN的管理工具,此工具能被用来管理用户账号的增删改查。 TurnServer:是TURN和STUN的服务器实现。 Turnutils_uclient: 模拟多个UDP、TCP、TLS或DTLS客户端 Turnutils_peer: 一个简单的无状态UDP-ECHO服务器,用作中继模式中的最终服务器 Turnutils_stunclient: 一个简单的STUN客户端例子 Turnutils_rfc5769check: 检查STUN/TURN协议实现的正确性。 我们..

Langeldep的专栏 1325

PAT 1006 (Advanced Level) 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 rec...

chizhonghang的博客 176

SAP 物料主数据 Forecasting 视图,别把预测只当成一个数字字段

摘要(150字): SAP S/4HANA物料主数据的Forecasting视图常被忽视,但对依赖历史消耗规律的物料至关重要。该功能基于工厂维度的历史消耗数据,结合预测参数自动计算未来需求,动态调整重订货点和安全库存。预测模板(Forecast Profile)能标准化参数设置,而消耗数据(Consumption Values)的质量直接影响预测结果。预测值作为MRP输入,需注意保存操作才能生效。自动重订货点功能通过分析消耗波动和服务水平,实现库存策略的动态优化。Individual Forecast功能则

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1448

【论文精读】《Towards Deep Learning Models Resistant to Adversarial Attacks》

本文探讨了深度学习模型在面对对抗性攻击时的脆弱性,并提出了一种基于鲁棒优化的方法来增强神经网络的对抗鲁棒性。通过鞍点优化框架,作者提供了对抗攻击和防御机制的统一视角,并在MNIST和CIFAR-10数据集上验证了其方法的有效性。对抗训练的核心思想是将对抗样本引入训练过程,使模型能够学习到对抗样本的特征,从而提升其鲁棒性。本文通过鞍点优化框架提出了一种基于鲁棒优化的对抗训练方法,显著提升了深度学习模型的对抗鲁棒性。本文为深度学习模型的对抗鲁棒性研究提供了新的理论和实证支持,同时为未来研究指明了方向。

nmdbbzcl的博客 613

PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642

PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642 题目描述: 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 sign

lingchen1120的博客 221

《UDS协议从入门到精通》系列——图解0x27:安全访问

什么是安全访问服务?应用场景和基本原理是什么?全网最直观详细的图解UDS-0x27:安全访问服务!!

车载系统攻城狮 7262

PAT-PAT (Advanced Level) Practise 1006. Sign In and Sign Out (25) (简单题)【一星级】

题目链接:http://www.patest.cn/contests/pat-a-practise/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

David_Jett 1032

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

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

PAT(Advanced Level) 1006 Sign In and Sign Out (25分)

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

Adolphrocs的博客 256

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

PAT (Advanced Level) 1007 Maximum Subsequence Sum( DP ) 1006 Sign In and Sign Out( map )

PAT 1007 #include<bits/stdc++.h> using namespace std; typedef pair<int,int>PII; typedef long long LL; const int maxn=1e4+5; const LL INF=0x3f3f3f3f3f3f3f3f; LL max(LL a,LL b) { retur...

老铁,干了这碗algorithms的博客 184

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

PAT (Advanced Level) Practice 1006 Sign In and Sign Out

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

Dunk.Wan 213

Pat(Advanced Level)Practice--1006(Sign In and Sign Out)

Pat1006代码 题目描述: 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 sig

奋起的Coder。。。 1140

PAT_ADVANCED LEVEL 1006 Sign In and Sign Out (25) 排序

1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue At the beginning of every day, the fi

高析的博客 929

PAT (Advanced Level) Practice 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 recor...

izhxxx的博客 265

PAT (Advanced Level) Practice — 1006 Sign In and Sign Out (25 分)

题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805516654460928 At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last on...

Mongo_girl 337

PAT (Advanced Level) 1006. Sign In and Sign Out (25) 解题报告

1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue At the beginning of every day, the fi

小夥的博客 329

PAT (Advanced Level) 甲级 1006 Sign In and Sign Out

简单的结构体排序,算出最早的那个时间和最晚的那个时间。刚开始想的是将所有的时间存储下来,然后排序找到首尾,但是后来发现完全没必要,那样只会徒增时间复杂度和空间复杂度。

qq_61793850的博客 221

【PAT (Advanced Level) Practice】1006 Sign In and Sign Out

这道题网上大佬的代码比我好 把时间直接当string输进来了 然后直接比 学到了学到了 #include<stdio.h> #include<string.h> #include<string> #include<iostream> #include<algorithm> using namespace std; struct stuIn...

weixin_41635596的博客 212

【PAT (Advanced Level) Practice】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 loc

多思考🤔~ 506
上一篇: PAT(Advanced Level) 1005 - Spell It Right (水题)
下一篇: PAT (Advanced Level) 1007 - Maximum Subsequence Sum(DP)
Snakeflute
博客等级 码龄11年 14粉丝 172原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值