Description
Every day the first person to the computer room to open the door, the last one to leave the door closed. A mess of the existing room
To and from the record, please find out the person who opened and closed the door according to the records.
Input
The first line of the test input gives the total number of days of the record N (> 0). The following is a list of N-Day records.
Each day the record in the first row gives the number of entries in the record m (> 0), the following is the M row, each line is formatted as
Passport number check-in time sign-off time
The time is given by "hours: minutes: Seconds" (2 bits each), and the ID number is a string of no more than 15 length.
Output
For each day of the record output 1 lines, that day open and close the person's identification number, the middle of 1 spaces separated.
Note: In the referee's standard test input, all records are guaranteed to be complete and each person's check-in time is before the checkout time.
And no more people sign in or sign out at the same time.
Ideas:
The comparison time can also do so.
#include <iostream>#include<cstring>using namespacestd;intMain () {intn,t; CIN>>u; stringName,start,end; while(t--) {cin>>N; CIN>>name>>start>>end; stringMin_start =start; stringMax_end =end; stringMax_name =name; stringMin_name =name; for(inti =1; I < n;i++) {cin>>name>>start>>end; if(Start <Min_start) {Min_start=start; Min_name=name; } if(End >max_end) {Max_end=end; Max_name=name; }} cout<<min_name<<' '<<max_name<<Endl; } return 0;}
HDU-1234 (String strings)