SOLVE

LATER

Foosball Tournament

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.

Table : **Strength**

Field | Type |
---|---|

Player | Text |

strength | int |

Table: **Team**

Field | Type |
---|---|

Player | Text |

Team_name | Text |

Field | Type |
---|---|

Team_name | Text |

Standings | int |

**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 |

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_Db

Initializing Code Editor...

{"aed71cb": "/pagelets/problem-author-tester/sql/fooseball-tournament/", "6740ac5": "/pagelets/recommended-problems/sql/fooseball-tournament/", "7128a49": "/pagelets/suggested-problems/sql/fooseball-tournament/", "8b91034": "/pagelets/show-submission/sql/fooseball-tournament/", "554975a": "/pagelets/problems-hint/sql/fooseball-tournament/"}

realtime.hackerearth.com

80

0605656f896fac6706468b3997fccdfe0af3cac8

58a29e5cae2309f04b28

/realtime/pusher/auth/