提交时间:2024-01-13 13:19:33

运行 ID: 36401

#include<algorithm> using namespace std; struct node{ int id; float score; }s[100]; bool cmp(node a,node b){ return a.score>b.score; } int main() { int n,k; cin>>n>>k; for(int i=1;i<=n;i++){ cin>>s[i].id>>s[i].score; } sort(s+1,s+1+n,cmp); cout<<s[k].id<<" "<<s[k].score; return 0; }