114514

Adolf Hitler  •  24天前


#include<bits/stdc++.h>
using namespace std; struct student {

int num;
double b;
}; struct student k[1000]; bool cmp(const student&a,const student&c){

return a.b>c.b;
} int main() {

int n,m;
cin>>n>>m;
for(int i=0; i<n; i++) {
	cin>>k[i].num>>k[i].b;
}
sort(k,k+n,cmp);
cout<<k[m-1].num<<" "<<k[m-1].b;
return 0;
}

评论:

请先登录,才能进行评论