Nine degrees 1371 the smallest number of K

Source: Internet
Author: User

Title Description: Enter n integers to find the smallest number of K. For example, enter 4,5,1,6,2,7,3,8 these 8 numbers, then the smallest 4 number is 1,2,3,4,.

Input:
Each test case consists of 2 rows: The first behavior is 2 integers n,k (1<=n,k<=200000), which represents the length of the array.

The second line contains n integers, representing the number of N, and the range of numbers in the array is [0,1000 000 000].

Output:
For each test case, output the minimum number of K and print from small to large order.
Sample input:
8 44 5 1 6 2 7 3 8
Sample output:
1 2 3 4

The difference between this problem is that the final output needs to be sorted, which is generally not required.

Nine degrees 1371 the smallest number of K

Related Article

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.