All Tracks Problem

Foosball Tournament
Tag(s):

Easy-Medium

Problem
Editorial
Analytics

Mishki being the future predictor knows the winning the order of the teams in the Foosball tournament. Each team will have several players and each player will have some strength to play foosball. The winning order will be defined by the power of each team.
Power of a team is defined as the number of players having distinct strengths in the team.
The team with maximum power will win the tournament and the team with second maximum power will come second and so on.

Mishki will be given 2 tables:
1) Strength : It will consists of 2 columns Player and its Strength.
2) Team: It will consists also 2 columns Player and its team.

She needs to tell the names of the Teams along with their standings in the tournament. Help her for the same.

Note:
1) You have to print the Team names and their standings in the ascending order of their standings.
2) It is guaranteed that, no two teams will have same power.

Input Format:

Table : Strength

Field Type
Player Text
strength int

Table: Team

Field Type
Player Text
Team_name Text

Output Format:

Field Type
Team_name Text
Standings int

Sample Input:

Sample Strength Table:

Player strength
A 12
B 12
C 12
D 13
E 14
F 13
G 1

Sample Team Table:

Player Team_name
A Champs
B Champs
C Champs
D Gamers
E Gamers
F Champs
G Gamers

Sample Output:

Team_name Standings
Gamers 1
Champs 2
Time Limit: 5 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: MySQL, PostgreSQL, MSSQL, Oracle Database

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications