直接干拉!!!
2026-08-14 20:08:51
发布于:陕西
1阅读
0回复
0点赞
#include<bits/stdc++.h>
#include<cmath>
using namespace std;
struct stu{
int id;
int sc;
};
bool cmp(stu a, stu b){
if(a.sc != b.sc){
return a.sc > b.sc;
}
return a.id < b.id;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int m, n;
cin >> m >> n;
stu st[114514];
for(int i = 0; i < m; i++){
cin >> st[i].id >> st[i].sc;
}
sort(st, st + m, cmp);
//计算面试分数线
int li = (int)(n * 1.5) - 1;
int ls = st[li].sc;
//统计面试人数
int cnt = 0;
for(int i = 0; i < m; i++){
if(st[i].sc >= ls){
cnt++;
}else{
break;
}
}
cout << ls << " " << cnt << endl;
for(int i = 0; i < cnt; i++){
cout << st[i].id << " " << st[i].sc << endl;
}
return 0;
}
这里空空如也







有帮助,赞一个