Submit | All submissions | Best solutions | Back to list |
EIKMAX - K greatest numbers |
Given n integers which the absolute value of each is not over 10^18, output k greatest elements.
Input
The first line contains two integers n and k (k<=n<=10^5).
The second lines contains n integers.
Output
A single line contains k greatest integers in descending order.
Example
Input: 5 3
1 6 5 0 7 Output: 7 6 5
Added by: | Ha Minh Ngoc |
Date: | 2018-04-19 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET |