- C20250174's blog
66999966696969696666666
- 2023-3-20 10:09:52 @
#include<bits/stdc++.h>
using namespace std;
int xuehao[505];
double chengji[505];
int main() {
int n,pm;
cin>>n>>pm;
for(int i=1; i<=n; i++) cin>>xuehao[i]>>chengji[i];
for(int i=1; i<=n; i++) {
int k=i;
for(int j=i; j<=n; j++) {
if(chengji[j]>chengji[k]) {
k=j;
}
}
swap(chengji[i],chengji[k]);
swap(xuehao[i],xuehao[k]);
}
cout<<xuehao[pm]<<' '<<chengji[pm];
return 0;
}