AC了好吧
2023-07-20 14:32:04
发布于:上海
0阅读
0回复
0点赞
nclude <bits/stdc++.h>
using namespace std;
int n, m;
struct k{
int id;
int sc;
}a[6000];
int c(k x, k y){return (x.sc > y.sc) || (x.sc == y.sc && x.id < y.id);}
int main(){
cin >> n >> m;
for (int i = 1;i <= n; i++){
cin >> a[i].id >> a[i].sc;
}
sort(a + 1, a + 1 + n, c);
int y = floor(m * 1.5);
int line = a[y].sc, num = 0;
for (int i = 1; i <= n; i++){
if (a[i].sc >= line){
num++;
}
}
cout << line << " " << num << endl;
for (int i = 1; i <= num; i++){
cout << a[i].id << " " << a[i].sc << endl;
}
return 0;
}
这里空空如也
有帮助,赞一个