HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Data Structures > problem:


50753 - Average of the Nth Student

Guest
• Review clarifications (1)

Volume problems

• 50750 - Service Time - 2
• 50771 - BST Level Sum
• 50536 - Epoka Furgon Shpk
• 50773 - Balanced Sum Tree
• 50757 - National Elections - 1
• 50706 - The most crowded Club
• 50689 - The biggest building block
• 50686 - The Container
• 50753 - Average of the Nth Stu...
• 50464 - From Tirana to Durres
• 50506 - The Biggest Island
• 50682 - Hotel Durres
• 50777 - Dwarfs Maze
• 50488 - Connecting Wires
• 50781 - ReversesreveR
• 50780 - Hot Potato - Revisited
• 50681 - Center of a Series

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 4500/4500/4500/4500 ms. Memory limit 110000/110000/110000/110000 Kb.
Question by Ibrahim Mesecan.

Average of the Nth Student

Chinese Minister of Education is having a visit to your country. He has heard that you have a nice program for schools. And now, he is asking you to prepare something for their their universtiy entrance exams.

Question:
Write a program that reads n students information (name, surname and an integer grade). Then,using count sort, your program will sort students according to the averages in descending order. And, it will show all students within the range from a to b.

Input specification
The first line of the input contains three integers (n, a and b) where n denotes the number of students and a nd b denotes the positions in the sorted list where 0 ≤ a < b ≤ n ≤ 200000 (two hundred thousand). Each of the following n lines will have semicolon separated information:

  • Name and Surname: At most 36 chars string containing only English letters and space ending with a semicolon.
  • Grade: an integer number between 0 and 10000

Output specification
Show all students from a to b with their names and grades.
Note:

  • Please pay attention that there are two million names thus, to avoid time limit, you can use count sort.
  • Positions start from 0.

Sample Input I   
  10 1 4
  Sherri Booker Haag; 5307
  Branda Dell Large; 5976
  Savannah Cecilia Mena; 5423
  Glory Adam Newman; 9648
  Sam Larson; 6079
  Virgil Emmy Rico; 7221
  Alexandra Cayla Frierson; 8307
  Laraine Azucena Cook; 8426
  Dalila Caroll Campbell; 7738
  Margie Bowman; 8426
Sample Output I   
  Margie Bowman; 8426
  Laraine Azucena Cook; 8426
  Alexandra Cayla Frierson; 8307
  Dalila Caroll Campbell; 7738


Для отправки решений необходимо выполнить вход.

www.contester.ru