21095_Numbers

2022-5-16 18:18| 发布者: Hocassian| 查看: 46| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504832419000-Problem List-采集的数据-后羿采集器.html

Pro.ID

21095

Title

Numbers

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21095

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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
    1
    2
    3
    4
    5
    3
    2
    3
    1
    2

    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
    1
    2
    3
    4
    5
    3
    2
    3
    1
    2

    样例输出

    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.

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部