HDU non-interference queue, (remember a failed SBT attempt)

Source: Internet
Author: User

Non-sincerity not to disturb

Time limit:3000/1000 MS (java/others) Memory limit:65535/32768 K (java/others) total submission (s): 1312 Accepted Submission (s): 473

Problem Description as a member of the 2013 6.99 million graduating students, because of the macroeconomic downturn, Xiao Ming on graduation day on the gorgeous job!   Experienced thousands of difficult job hunting process, Xiao Ming especially can understand the employment of graduates difficult, so, he is now ready to create a specialized for it talent job-seeking intermediary company-non-prudential do not Disturb human resources Development Co. Based on the needs of the job, Xiao Ming according to the applicant's CV described as each person assessed a comprehensive ability value, the ability value is a positive integer less than or equal to 20, the higher the value of the more powerful. When a company tries to recruit IT staff (only 1 at a time), it needs to present a minimum requirement of comprehensive ability, and if there are qualified personnel in the talent pool, it will be able to recruit successfully.   Of course, if a number of students at the same time to meet the needs of the recruitment company, in view of the scarcity of high-capacity talent, Xiao Ming always priority to the ability of low-value candidates to recommend the past; if there are still more than one person to meet the requirements, then Xiao Ming will be the first to apply for the student to recommend the past. It is necessary to note that at the beginning of the company's talent pool is empty, and a student can only be signed with a company, if the recommendation is successful, the student's information needs to be removed from the talent pool. The first line of the  input input data is a positive integer t (1 <= T <= 20), which indicates that there is a T-group of test data; the first row of each set of test data is an integer n (0 <= N <= 1000), which indicates that n events have occurred in chronological order. Next n rows, each row describes an event. For an event, first a string "add" or "find", where "add" means that a student joins the talent pool, "Find" means that a company wants to recruit a person. If the string is "Add", then there will be a string s and a number d, separated by a space, respectively, the name of the student and the comprehensive ability value, the name is composed of lowercase letters, not empty and the length of not more than 15; If the string is "Find", then there will be a number, Represents the minimum requirement of recruiting company for the comprehensive ability of talents.  output for each set of test data, the first line outputs "Case #c:" (without quotation marks) C is the number of groups of test data, starting at 1. Then output n rows, indicating the results of N events if the event is to add talent information into the storage, then please output the number of personnel in the talent pool after the information is added; If this event is an enterprise to recruit, then please output will be hired talent name, if no talent meet the requirements, please output "WAIT ..."   Sample INPUT1 5 Add LCY 1 Add lyd Find all find add Zxs 10 sample OUTPUtcase #1:1 2 lyd WAIT ... 2

HDU non-intrusive queue, (remember a failed SBT attempt)

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.