Give you a sequence of integers with length $N$, please find the "mode" of the sequence.
A "mode" of a sequence is the number which appears most often in this sequence.
The first line contains a positive integer $N\ (N\leq10^ 5)$ - the length of sequence.
The second line contains $N$ positive integers, the $i_{th}$ number $a_i\ (a_i\leq10^ 5)$ represents the $i_{th}$ element of a sequence.
Print the mode of sequence at first line. If there are more than one mode, print all of them and separate each mode by a space. The order of modes does not matter.
Then print how many times the mode appears at second line.
No. | Testdata Range | Constraints | Score |
---|---|---|---|
1 | 0~4 | $N, a_i\leq3000$, and the answer will be unique | 10 |
2 | 0~11 | The answer will be unique | 10 |
3 | 0~17 | No specified restriction | 5 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 | |
6 | 1000 | 65536 | 65536 | |
7 | 1000 | 65536 | 65536 | |
8 | 1000 | 65536 | 65536 | |
9 | 1000 | 65536 | 65536 | |
10 | 1000 | 65536 | 65536 | |
11 | 1000 | 65536 | 65536 | |
12 | 1000 | 65536 | 65536 | |
13 | 1000 | 65536 | 65536 | |
14 | 1000 | 65536 | 65536 | |
15 | 1000 | 65536 | 65536 | |
16 | 1000 | 65536 | 65536 | |
17 | 1000 | 65536 | 65536 |