PAT 1006. Sign In and Sign Out

#include<iostream>
#include<string>
using namespace std;
int main(){
  int cnt;cin>>cnt;
  string first,last,in("44:44:44"),out("00:00:00");
  while(cnt--){
    string a,b,c;cin>>a>>b>>c;
    if(b<in){first=a;in=b;};
    if(c>out){last=a;out=c;}
  }
  cout<<first<<' '<<last;
  return 0;
}
时间: 2024-08-01 21:22:36

PAT 1006. Sign In and Sign Out的相关文章

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 out's, you are supposed to f

1006. Sign In and Sign Out (25)——PAT (Advanced Level) Practise

题目信息: 1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 32000 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 th

pat1006. 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 first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door

PAT 1006 换个格式输出 C语言

让我们用字母B来表示"百".字母S表示"十",用"12...n"来表示个位数字n(<10),换个格式来输出任一个不超过3位的正整数.例如234应该被输出为BBSSS1234,因为它有2个"百".3个"十".以及个位的4. 输入格式:每个测试输入包含1个测试用例,给出正整数n(<1000). 输出格式:每个测试用例的输出占一行,用规定的格式输出n. 输入样例1: 234 输出样例1: BBSSS1

1006.Sign in and Sign out(25)—PAT 甲级

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 a

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

简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdio> #include<vector> using namespace std; struct X { string name; int a,b; }s[10000]; int n,hh,mm,ss; bool cmp1(const X&a,co

PAT 甲级 1006 Sign In and Sign Out

1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 6 using namespace std; 7 struct oi{ 8 string name; 9 int h1, m1, j1; 10 int h2, m2, j2; 11 }; 12 int bijiao1(oi x, oi y) 13 { 14 if (x.h1!=y.h1

PAT甲题题解-1006. Sign In and Sign Out (25)-找最小最大

判断哪个人最早到,哪个人最晚走水,就是找最大值最小值 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string.h> using namespace std; int m; char unlock[20],lock[20]; char start[20]="25:00:00",endtime[20

pat(A)1006. Sign In and Sign Out (结构体排序)

代码: #include<cstdio> #include<algorithm> using namespace std; struct Node { char s[20]; int in[3]; int out[3]; }; int cmp1(Node a,Node b) { if(a.in[0]==b.in[0]&&a.in[1]==b.in[1]) { return a.in[2]<b.in[2]; } else if(a.in[0]==b.in[0])