HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Search > problem:


50189 - Top Question

Section problems

• 50120 - Group Total
• 50126 - The Highest Average
• 50128 - School contest
• 50129 - Sequential Numbers
• 50158 - Count and Sum
• 50160 - Number of Prime numbers
• 50168 - Processing the list of numbers
• 50188 - Swimming Contest
• 50189 - Top Question
• 50190 - Eight Puzzle
• 50203 - Breaking the Bunker
• 50209 - Number of Student Certificates
• 50210 - The largest Student Group
• 50211 - Sum of the Pairs
• 50212 - Buy the cheapest
• 50213 - Average of the Best Grades
• 50282 - The biggest number

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.

Top Question

Your friend works as a teacher in a school and he organizes multiple choice exams throughout the school and he needs your support for his multiple choice exams. He records student answers in a file and he wants to see the top solved question

Question: Write a program that reads n exams for n students and it prints the top solved question.

Input specification
At the beginning, you will be given two numbers (n and m). Next line contains m space separated letters which are the correct answers of the exam. The following n lines contain the answers of n students. The student answers can be a letter from A to Z where 1 ≤ n ≤ 1,000 and 1 ≤ m ≤ 100.

Output specification
Show the number of the top solved question. Note: Show the first occurrence, if there are several questions with the same result.

Sample Input I
3 5
C E D E C
C E D B A
B E D E C
C E D E C
Sample Output I
2

Explanation: All students answered second and third questions correctly. So, the first top solved question is the second question.

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

www.contester.ru