#T444. OJ题目AC率
OJ题目AC率
Description
"x problems, x problems, x+1 problems, x problems, x+2 problems, x problems..." The administrator of CodesOnline club stared blankly at the AC submission table.
Why have so many members solved exactly X problems? Has half the club solved x problems?
Given the number of members and the count of problems each member has solved, can we determine if more than half of them have solved the same number of problems?
Input Format
The input consists of multiple test cases.
Each test case contains two lines.
The first line contains a positive integer n (≤ 10000), representing the number of members.
The second line contains n positive integers (≤ 10000), representing the number of problems each member has solved.
Output Format
For each test case, if more than half of the members have solved the same number of problems, output that count. Otherwise, output 0.
Adapted Problems from "Sword Finger Offer"
Note:
- "剑指Offer" is translated as "Sword Finger Offer" (the official English title of this well-known coding interview book)
- The translation maintains the concise style of the original while making it clear these are modified/adapted problems from the source material
- The markdown heading format is preserved exactly