0
已解决
张亦阳
资深守护
资深守护
0分
求各位大佬找错
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct hh{
int name,score;
}a[9999];
int n,m,f,cnt;
bool cmp(hh a,hh b){
if(a.score!=b.score) return a.score>b.score;
return a.name<b.name;
}
int main(){
cin>>n>>m;
for(int i=i;i<=n;i++){
cin>>a[i].name>>a[i].score;
}
sort(a+1,a+1+n,cmp);
f=a[int(m*1.5)].score;
for(int i=i;i<=n;i++){
if(a[i].score>=f) cnt++;
}
cout<<f<<" "<<cnt<<endl;
for(int i=i;i<=n;i++){
if(a[i].score>=f) cout<<a[i].name<<" "<<a[i].score<<endl;
}
return 0;
}