Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

=+What ways did it affect you? How do you know?

Answered: 1 week ago

Question

Enhance the basic quality of your voice.

Answered: 1 week ago

Question

Describe the features of and process used by a writing team.

Answered: 1 week ago