HDU-1234 (String strings)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.