import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; class Stu{ String Sno; double Score; public Stu(String Sno,double Score){ this.Sno= Sno; this.Score=Score; } } public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(),k=sc.nextInt(); Stu[]s=new Stu[n]; for (int i =0; i<n ; i++) { s[i]=new Stu(sc.next(),sc.nextDouble()); } Arrays.sort(s,new Comparator<Stu>(){ @Override public int compare(Stu o1, Stu o2) { if(o2.Score>o1.Score) return 1; else return -1; } }); System.out.print(s[k-1].Sno+" "); if(s[k-1].Score%1==0) System.out.println((int)s[k-1].Score); else System.out.println(s[k-1].Score); } }
0.0分
1 人评分