求助!50分,错两个
查看原帖
求助!50分,错两个
654004
Zhouyuhan_1125楼主2023/2/18 11:07
#xinclude <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 10;
struct node{
	int x1, x2, y1, y2;
};
node a[N];
int n,m; 
int main(){
	cin >> n >> m;
	for(int i = 1; i <= n; i++){
		cin >> a[i].x1 >> a[i].x2 >> a[i].y1 >> a[i].y2;
	}
	while(m--){
		int x,y;
		cin >> x >> y;
		int ans = 0,cnt = 0;
		for(int i = 1; i <= n; ++i){
			if(x >= a[i].x1 && x <= a[i].x2 && y >= a[i].y1 && y <= a[i].y2){
				ans++;
				cnt = i;
			}
		}
		if(ans == 0){
			cout << "NO" << endl;
		} else {
			cout << "YES" << ans << " " << cnt << endl;
		}
	}
	return 0;
}

@dalaomen 错在哪里???

2023/2/18 11:07
加载中...