import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out)); String[]b=sc.readLine().split(" "); int n=Integer.parseInt(b[0]); int k=Integer.parseInt(b[1]); String[] a=sc.readLine().split(" "); Arrays.sort(a,new Comparator<String>(){ @Override public int compare(String o1, String o2) { return Integer.parseInt(o1)-Integer.parseInt(o2); } }); for (int i = n-1; i >=n-k; i--) { out.print(a[i]+" "); } out.flush(); } }
0.0分
1 人评分