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

Турниры > IMPC16 Group Contests > задача:


21. 50873 - Max Frequency

IMPC16 Group Contests

Старт: 16.янв.2016 в 10:00:00
Финиш: 16.янв.2016 в 14:00:00
Турнир завершён!
• Турнирная таблица

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

Задачи турнира

• 01. 50832 - Rock Paper Scissors Liz...
• 02. 50833 - Min of Odd Positions
• 03. 50834 - The train which leaves ...
• 11. 50859 - Low performance
• 12. 50860 - Number of Student Certi...
• 13. 50861 - The largest Student Group
• 14. 50862 - Sum of the Pairs
• 15. 50863 - Total Access Cost of a BST
• 21. 50873 - Max Frequency
• 22. 50874 - Apartment Building Adm...
• 23. 50875 - Take m-out
• 24. 50876 - He is my cousin
• 25. 50877 - Friendly Queue
• 32. 50926 - School Mail Merge
• 33. 50927 - Health Expenses
• 34. 50928 - War Of Battleships
• 35. 50929 - Present from your uncles

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan and Sidrit Reka.

Max Frequency

Question: Your sister has a math homework. She has to find the max frequency of some sequences complying the given function. The professor gives n squences of numbers and two numbers. She has to count the number of numbers which are greater than or equal to the first number and smaller than or equal to the second number.

Question: Write a program that finds the index of the sequence which has the highest frequency.

Input specification
You will be first given three numbers: the number of sequences, and two numbers (a-lower bound) and (b-upper bound) where 0 ≤ n ≤ 2000 and -50,000 ≤ a ≤ b ≤ 50,000. Then in the following n lines, you will be given n sequences. Each line contains first a number k, and the number of numbers in the sequence. Then on that line, you will be given k numbers where 0 ≤ k ≤ 2000 and the numbers are between -50,000 and 50,000.

Output specification:
Show the index of the sequence with the max frequency complying the given condition. Note: If there are several sequences with the same max frequency, show the index of the last sequence.

Sample Input I
7 -3 5
5 -6 -1 -8 -4 -14
9 -1 5 -3 -8 8 -6 11 -5 -9
7 8 4 14 9 9 11 -13
10 9 -6 12 -11 15 -8 -11 8 7 1
6 15 14 -6 13 -3 3
8 6 1 -1 0 -9 -3 -3 -6
9 0 5 1 4 13 -11 -6 -8 -8
Sample Output I
6

Explanation: There are 7 sequences given. And, we need to count the number of numbers which are between -3 and 5. There is only one number between a and b on the sequences: 1, 3 and 4. And, there are 5 numbers between a and b on the sixth sequence: 1, -1, 0, -3, and -3.



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

www.contester.ru