Question
Python problem: standings table Your problem should generate standings table according to the information from logs. Each line should contain student login and number of
Python problem: standings table
Your problem should generate standings table according to the information from logs. Each line should contain student login and number of problems solved by this student. Students should be sorted in descending order of the number of solved problems. If two students have same number of solved problems, they should be printed in alphabetical order.
Input format
First line contains single integer number: 1 N 10000 number lines in the log file.
Following N lines describe the log file. Each of these lines contains student login terminated by line break character. Each login consists of 1-100 lowercase latin letters (a-z).
Output format
Your output should have N lines. Each should contain login of student followed by number of problems solved by this student. Students should be sorted in descending order of the number of solved problems. If two students have same number of solved problems, they should be printed in alphabetical order.
Time limit: 1 second
Memory limit: 256 Mb
Sample 1
Input
| Output
|
---|---|
3 kormen kormen kormen | kormen 3 |
Sample 2
Input
| Output
|
---|---|
3 knuth kormen dijkstra | dijkstra 1 knuth 1 kormen 1 |
Sample 3
Input
| Output
|
---|---|
7 knuth kormen kormen knuth dijkstra dijkstra dijkstra | dijkstra 3 knuth 2 kormen 2 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started