#P1097. [NOIP 2007 提高组] 统计数字
[NOIP 2007 提高组] 统计数字
Description
In a research survey, natural numbers were collected, each not exceeding . It is known that the number of distinct values does not exceed . Now you need to count how many times each natural number appears and output the results in ascending order of the numbers.
Input Format
There are lines in total.
- The first line contains an integer , the number of natural numbers.
- Lines to each contain one natural number.
Output Format
Output lines in total (where is the number of distinct numbers among the natural numbers), in ascending order of the numbers.
Each line outputs integers: the natural number and the number of times it appears, separated by a single space.
8
2
4
2
4
5
100
2
100
2 3
4 2
5 1
100 2
Hint
- 30% of the testdata satisfy: .
- 60% of the testdata satisfy: .
- 100% of the testdata satisfy: , and each number does not exceed .
NOIP 2007 Senior, Problem 1.
Translated by ChatGPT 5
京公网安备 11011102002149号