Number sequencing of the CCF series (201503-2)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.