大佬们,求助为什么问我编译过不去?
查看原帖
大佬们,求助为什么问我编译过不去?
1018548
luogu_avatar楼主2024/8/30 11:14
#include<bits/stdc++.h>
using namespace std;
const int w = 1e7 + 5;
struct node{
	int id;
	int score;
}o[w];
bool is(node a,node b){
	if(a.score != b.score) return a.score > b.score;
	else return a.id < b.id;
}
int n,m,num,ans;
int main(){
	cin >> n >> m;
	for(int i = 1; i <= n; i++) cin >> o[i].id >> o[i].score;
	sort(o + 1,o + 1 + n);
	ans = o[m * 3 / 2 - 1].score;
	for(int i = 1; i <= n; i++){
		if(o[i].score >= ans) num++;
	}
	cout << ans << " " << num << endl;
	for(int i = 1; i <= ans; i++){
		cout << o[i].id << " " << o[i].score;
		if(i != ans) cout << endl;
	}
	return 0;
}
2024/8/30 11:14
加载中...