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 , denoting teams.
The next lines will contain , , , all separated by a single space. is the team name, all uppercase letters only, at most 20 letters long. is the team type, either general
or girls
. And is the number of points that the team has . 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
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.
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.
Is the score definetly integer?
Yes.
Username relevant.
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?
Emphasis on able
Emphasis on zero teams
yes.
Use your judgement.
and