MNYC '16: ECOO!

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

The ECOO programming contest is coming up soon and it's about time to determine which teams will represent Mackenzie at ECOO. Siavash is curious if his team will be one of these teams. Help him determine the teams that will go to ECOO. Each school is able to send 2 general teams and 1 girls team. Any team type can qualify as a general team, but only girls teams can compete as a girls team. We will send the best teams possible from our school. To determine the best teams, we host the JDCC competitions. The higher a team's JDCC score, the better they are considered as a team at programming. Given all the team names, their scores on the JDCC and their team type (general or girls), output the name(s) of the team(s) representing Mackenzie at ECOO, in alphabetical order. If zero teams will represent Mackenzie, output No ECOO :(.

Input Specification

Input will begin with an integer 0 \le N \le 100, denoting N teams.

The next N lines will contain S, T, P, all separated by a single space. S is the team name, all uppercase letters only, at most 20 letters long. T is the team type, either general or girls. And P is the number of points that the team has 0 \le P \le 1\,000\,000. No two teams will have an equal number of points and no two teams will have the same team name.

Output Specification

The teams to send to ECOO in alphabetical order, each on a separate line, or No ECOO :( on a single line if no teams are to be sent.

Sample Input

6
A general 1001
H girls 849
G girls 850
B general 999
C general 950
D general 951

Sample Output

A
B
G

Explanation for Sample Output

Team G is the highest scoring girls team, so they will advance to ECOO. A and B are the two highest scoring general teams, so they also go to ECOO. A, B and G are the three teams that will go in alphabetical order.


Comments


  • -1
    Quality_of_Perfection  commented on Aug. 14, 2016, 7:26 p.m. edited

    Can someone please tell me why I'm getting 4/5. I read the problem many times and I still can't figure it out.Or can someone please give me a hint.


    • 1
      aurpine  commented on Aug. 16, 2016, 8:44 a.m. edited

      Edge cases :D Consider cases where there are very few teams and cases where there are only a certain amount of the types of teams.


  • 0
    fed80  commented on Dec. 31, 2015, 5:20 p.m. edited

    Is the score definetly integer?


  • 3
    kushanzaveri  commented on Dec. 30, 2015, 5:55 p.m. edited

    If there were two teams, both of which were general, does that mean that there is No ECOO because it doesn't satisfy the condition of having at least 1 girl team?


    • 0
      aurpine  commented on Dec. 30, 2015, 5:56 p.m. edited

      Each school is able to send 2 general teams and 1 girls team.

      Emphasis on able

      If no teams will represent Mackenzie, output No ECOO :(.

      Emphasis on no teams


  • 1
    kobortor  commented on Dec. 30, 2015, 4:56 p.m. edited

    4 A general 10 B general 20 C girls 500 D girls 499


    • 1
      aurpine  commented on Dec. 30, 2015, 5:11 p.m. edit 2

      Use your judgement.

      We will send the best teams possible from our school.

      and

      Any team type can qualify as a general team, but only girls teams can compete as a girls team.