14952 - University Selection Process   

Description

A university wants to do a selection to accept the students into their school based on: (priority in descending order)

  1. GPA
  2. Highschool rating
  3. Essay rating
  4. Interview rating
  5. Counselor recommendation rating

 

Rules

1 has the highest priority and 5 is the lowest priority to get admission.

A student with any one of the ratings lower than 2 will be declined.

If there are 2 or more students with the same GPA, high school rating, essay rating, interview rating and counselor rating, then the students who apply first will have higher priority.

 

Example

John has GPA 3 and highschool rating 4

Raffa has GPA 4 and highschool rating 2

Mark has GPA 3 and highschool rating 3.9

 

The priority would be Raffa -> John -> Mark.

Raffa is the first one because he has the highest GPA.

John and Mark have the same GPA, but they have different school ratings, so we choose John over Mark because John’s school rating is higher than Mark’s.

 

This priority list will determine students' position in the selection process, whether a student is in the admission list, waiting list, or declined list.

 
Additionally, the school only accpets students that come from certain countries and are born within a specific range of period.
 
For more details, please refer to the Homework PDF on eeclass.

 

Input

There are 4 functions that we can call: [ ] means that the data is a parameter(variable)

  1. add c (c is the number of people that we want to add)
    • ​​​Format: [first name] [last name] [GPA] [Highschool] [Essay] [Interview] [Recommendation] [Country] [birth year] [birth month]
  2. n [number] (print out the top [number] people in the priority list)
  3. p [which type] [number] (print out top [number] elements which have the highest frequency)
  4. finish (which terminates the code). It has two types:
    • finish [number]
      • Print out all of the people in the admitted list (this will be the first [number] people in the priority list).
      • Also print out the people in the waiting list (the remaining people in the priority list) and the declined list (those who are not qualified).
    • finish x
      • ​Does not need to print anything.

 

Constraint

  • Only <iostream> and <string> are acceptable. Other than these are not allowed.

  • The maximum total number of people is 100000.

  • 0 <= n, p <= 100000. If n or p is 0, no need to print anything.

  • There will be no negative number in the input.

  • If the country and year are outside the accepted range by the university, the students will be automatically declined. If the student gives the wrong month(e.g., month 13 or month 0), the application will also be considered invalid.

  • There might be some cases in which students with the same name exist. In this case, regard them as different people and do the sorting as usual.

 

Output

Notes

  • For every type of command, you need to print out two newlines after the answer.
  • For "finish" command, there will always be a space character after the colon ':'. E.g., "Declined list(space):(space)(newline)".

 

Sample Input  Download

Sample Output  Download




Discuss