easy
2025-07-06 08:32:41
发布于:浙江
0阅读
0回复
0点赞
#include<iostream>
#include<algorithm>
using namespace std;
typedef struct info{
int k,s;
bool operator<(info& other){
if (other.s!=s) return s>other.s;
return k<other.k;
}
}_;
int main(){
int n,m,cnt=0;
_ a[5010];
cin>>n>>m;
for (int i=0;i<n;i++) cin>>a[i].k>>a[i].s;
sort(a,a+n);
int line=m*1.5-1;
int sc=a[line].s;
cout<<sc<<' ';
for (int i=0;i<n;i++) if (a[i].s>=sc) cnt++;
cout<<cnt<<endl;
for (int i=0;i<n;i++) if (a[i].s>=sc) cout<<a[i].k<<' '<<a[i].s<<endl;
return 0;
}
这里空空如也
有帮助,赞一个