- 浏览: 36430 次
- 性别:
- 来自: 杭州
最新评论
请根据记录找出当天开门和关门的人。
Sample Input:
3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40Sample Output:
SC3021234 CS301133
#include <iostream> #include <string> using namespace std; int main() { int M; cin>>M; int Entertime = -1; int Leavetime = -1; string EnterID,LeaveID; while (M--) { string str; int t1,t2,t3,t4,t5,t6; char c; cin>>str>>t1>>c>>t2>>c>>t3>>t4>>c>>t5>>c>>t6; int time1 = t1*3600 + t2*60 + t3; int time2 = t4*3600 + t5*60 + t6; if (time1 < Entertime || Entertime == -1) { EnterID = str; Entertime = time1; } if (time2 > Leavetime || Leavetime == -1) { LeaveID = str; Leavetime = time2; } } cout<<EnterID<<" "<<LeaveID; return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 768Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 656Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 752找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1042 Shuffling Machine
2012-11-23 23:42 727扑克洗牌 #include < ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 953求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 710Sample Input 1: 3 Joe M Mat ... -
PAT1035 Password
2012-11-23 23:40 612Sample Input 1: 3 Team0000 ... -
PAT1031 Hello World for U
2012-11-22 23:54 649Sample Input: helloworld! S ... -
PAT1029 Median
2012-11-22 23:54 648用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 802用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 616Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 765Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 682大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 648已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 534十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 656Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1663由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 643Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 766十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 922四门功课,输出排名最高的是哪个 Sample Inpu ...
相关推荐
为了记录我在准备PAT甲级的练习,特开此页。 ... 但是由于代码风格的不同,我在学习他们的想法的同时也在努力形成自己的C++代码风格。...Sign In and Sign Out https://blog.csdn.net/weixin_42426496/article/detai
PAT OJ exercises in C language 浙江大学PAT纯C语言题解。
PAT OJ exercises in C language 纯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 ...
浙江大学PAT乙级测试训练题目
Neural Networks and Deep Learni - Pat Nakamoto.azw3
So I just add some logic to my .dcu files loader to generate .pat files in right format Supported Delphi versions: Delphi 2007 (v12) Delphi 2009 (v14) Delphi 2010 (v15) Delphi XE (v16) Delphi XE2 ...
directed learners.Pat Morin is an associate professor in the School of Computer Science at Carleton University as well as founder and managing editor of the open access Journal of Computational ...
[下载工具].Tonec.Inc.Internet.Download.Manager.v6.05.5.WinALL.Incl.Keygen.and.Patch-BRD.zip
CAD填充图案(三百多种)-.pat文件 部分如下(篇幅有限) 2x12木地板.pat 45度人字形砖面(1).pat 8x8无缝砖.pat Z形砖.pat 丁字砖面1.pat 丁字砖面2.pat 三联蜂窝.pat 三角形拼铺.pat 不能通行的沼泽地.pat 乱沙.pat...
浙大pat1002 C++代码
PAT甲级题目目录,按照一定规律分类,题目从新到...1082 Read Number in Chinese (25 分)【将数字转成中文】 1093 Count PAT's (25 分)【PAT计数】 1071 Speech Patterns (25 分)【如何将词取出并进行计数】
PAT历年真题参考代码PAT历年真题参考代码PAT历年真题参考代码
为PAT考试作宣传用,希望广大的师生们,积极踊跃的参加
PAT甲级优秀辅导资料
The Process Analysis Toolkit (PAT) is a CSP analysis tool developed in the School of Computing at the National University of Singapore. PAT is able to perform refinement checking, LTL model-...
PAT题解
photosh素材pat文件,
patb工程文件的说明文档,对patb工程文件的说明。adj、image、ori、cont。
我的PAT乙级练习题1001代码记录,题目地址:https://www.patest.cn/contests/pat-b-practise/1001