提交时间:2024-01-13 13:09:12
运行 ID: 36392
#include<bits/stdc++.h> using namespace std; struct s{ int id; double score; }a[10005]; bool cmp(s a,s b){ return a.score>b.score; } int main() { int x,k; cin>>x>>k; for(int i=1;i<=x;i++){ cin>>a[i].id >>a[i].score ; } sort(a+1,a+1+x,cmp); cout<<a[k].id<<" "<<a[k].score <<endl; return 0; }