B. 练60.2 众数

    Type: Default 1000ms 64MiB

练60.2 众数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

For a sequence {ana_n} of length nn, its mode is defined as the number that appears most frequently.
Given a sequence of length nn, please help find its mode.
Note that there may be multiple modes, you only need to output the smallest one.

Input Format

The first line contains nn, and the second line contains nn numbers, where n<106n<10^6 and 0ai10000≤a_i≤1000.

Output Format

Output the mode.

Sample

6
3 5 7 5 3 1
3

20251101C班作业(5)

Not Claimed
Status
Done
Problem
6
Open Since
2025-11-1 0:00
Deadline
2025-11-9 23:59
Extension
24 hour(s)