• [1543] No Girlfriend

  • 时间限制: 2000 ms 内存限制: 262144 K
  • 问题描述
  • You know the day after tomorrow is Valentine's Day, but I have no girlfriend.

    Now, I'll give you a big task, help me take away a person!

    If you take away that person, others who want to appointment with him/her will feel disappointed.

    Your task is to let maximum people feel disappointed.

  • 输入
  • There are multiple test cases, each test case contain a positive number N (1 <= N <= 100).
    Following N lines, for the ith line (1-Based) contain a positive integer P (1 <= P <= N), represent the ith people want to appointment with P.
    Note: Everyone has a distinct number, the ith people's number is i.
  • 输出
  • For each case, output the answer in one line.
  • 样例输入
  • 3
    3
    1
    1
    5
    5
    5
    2
    2
    2
    
  • 样例输出
  • 2
    3
    
  • 提示
  • For the first test case.
    If you take away 1, then 2 and 3 will feel disappointed.
    If you take away 2, nobody will feel disappointed.
    If you take away 3, then 1 will feel disappointed.
    So the maximum people feel disappointed is 2. 
    
  • 来源
  • 本站或者转载
  • 操作

显示春菜