提交时间:2024-01-13 15:58:15
运行 ID: 36466
#include<bits/stdc++.h> using namespace std; struct node{ int id; double score; }a[1000]; bool cmp(node a,node b){ return a.score<b.score; } int main() { int i,m,n; cin>>n>>m; for(i=0;i<n;i++){ cin>>a[i].id>>a[i].score; sort(a,a+n,cmp); printf("%d %g",a[m-1].id,a[m-1].score); } return 0; }