• [D] Clear Up

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • There is a game. For many colors of blocks, if there are two blocks with the same color, they will be cleared up. But there are so many colors of blocks. When you clear up all of the blocks, you will enter the next level.
    Now, we change a little about the game. When game starts, there are N (N is an even number) numbers of blocks piled up like a wall, you need to clear up some blocks when they are the same color. But there are always left two blocks at last with different colors.
    Now, we define color digits, it means different digit instead different color.
    So, what two digits will be left?

  • 输入
  • Input until EOF.
    First line will contain an even integer N (N < 1, 000, 000) means the number of blocks.
    And next line will contain N un-negative integers means digits. Each digit will be less than 10, 000, 000.
  • 输出
  • Output the digits of two blocks from smaller to larger.
  • 样例输入
  • 4
    1 2 2 3
    6
    1 1 1 1 1 2
    
  • 样例输出
  • 1 3
    1 2
    
  • 提示
  • 来源
  • Hungar
  • 操作

显示春菜