Problem description
Question number: 201503-2
Question name: Sort by number
Time limit: 1.0s
Memory Limit: 256.0MB
Problem Description:
Problem description
given n integers, count the number of occurrences of each integer and output in the order of occurrences, from many to fewer.
Input format
The first line of input contains an integer n, which represents the number of a given number.
The second row contains n integers, separated by a space between adjacent integers, representing the given integer.
Output format
Outputs multiple lines, each containing two integers, representing a given integer and the number of times it appears. Output in descending order of occurrences. If two integers occur as many times as possible, the output value is smaller and the output value is larger.
Sample input
5 2 3 3 1 3 4 2 5 2 3 5
Sample output
4
3
3
1
1
Measuring use case size and conventions
1≤n≤1000, the given number is a non-negative integer of not more than 1000
Number sequencing of the CCF series (201503-2)