Pro.ID21095 TitleNumbers Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21095 AC0 Submit0 Ratio- 时间&空间限制描述You are to write a program, which, given N positive integer values X1, X2, ..., XN, computes the smallest number Xi that appears in the sequence at least as many times as any other number. 输入The output file name is numbers.out. The the first line is to contain one integer, the smallest number to appear at least as many times as any other number. In all inputs, 2 ≤ N ≤ 1000, and for each Xi , 1 ≤ Xi ≤ 10000. 输出Description You are to write a program, which, given N positive integer values X1, X2, ..., XN, computes the smallest number Xi that appears in the sequence at least as many times as any other number. Input The output file name is numbers.out. The the first line is to contain one integer, the smallest number to appear at least as many times as any other number. In all inputs, 2 ≤ N ≤ 1000, and for each Xi , 1 ≤ Xi ≤ 10000. Output The output file should contain a single line with a single integer that is the length of the longest consecutive sequence of lines that HAL might have copied from RBN and transformed. Sample Input 10 Sample Output 2 Hint Lines 1-2 of RBN's program are the same as lines 2-3 of HAL's program, if the following variable name substitutions are performed on RBN's program: RA → HM, RB → D, RC → HN, D → HA, RE → HB. There is no matching with three or more lines. Source 样例输入10 样例输出2 提示Lines 1-2 of RBN's program are the same as lines 2-3 of HAL's program, if the following variable name substitutions are performed on RBN's program: RA → HM, RB → D, RC → HN, D → HA, RE → HB. There is no matching with three or more lines. 作者 |