HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC16 Group Contests > problem:


21. 50873 - Max Frequency

IMPC16 Group Contests

Start: Jan.16.2016 at 10:00:00 AM
Finish: Jan.16.2016 at 02:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (3)

Contest problems

• 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

Feedback

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

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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