Submit | All submissions | Best solutions | Back to list |
EI20213Q1B - List of numbers (2) |
Given a list of N integers, output the list of top K numbers in descending order. If some numbers are equals, prefer to print the numbers which have higher index.
Input
-
The first line contains two integers N and K (1 ≤ N, K ≤ 105).
-
The next line contains N integers which do not exceed 109.
Output
Include K lines, each line is an integer and the its index in the input.
Sample
Added by: | Ha Minh Ngoc |
Date: | 2021-07-10 |
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 |