Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Given an array of integers with values between 0 and ~10^{6}~. Find the most occurring number.
Input
The first line is the number of elements in the array N (N ≤ ~10^{6}~).
The second line contains N integers ~ai~ are the elements in the array (0 ≤ ~ai~ < ~10^{6}~ ).
Output
- Output the value and the number of times occur in the array. If there are many number have the same frequency, output minimum number.
Sample Input:
4
4 3 4 3
Sample Output:
3 2
Bình luận