ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Сортировка и последовательности > задача:


50753 - Average of the Nth Student

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 50358 - Series of Odd Numbers
• 50756 - Average of the Nth Student
• 50757 - National Elections - 1
• 50755- Top N Donors - 1
• 50752 - Student Groups
• 50753 - Average of the Nth Stu...
• 50751 - The biggest Minute
• 50998 - CEN112 Homework, quiz av...
• 50804 - Marathon
• 50835 - Club Presidency
• 50747 - Safe boxes against thieves
• 50742 - King Arthur II
• 50352 - Selling Cows
• 50872 - Top M Grades

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 4500/4500/4500/4500 мс. Лимит памяти 110000/110000/110000/110000 Кб.
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