求报错原因
  • 板块灌水区
  • 楼主Ac_Code_cn_com
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/11/16 21:17
  • 上次更新2023/11/17 06:50:10
查看原帖
求报错原因
1014410
Ac_Code_cn_com楼主2023/11/16 21:17
#include<bits/stdc++.h>
using namespace std;
long long m,n,x,y,x1[2010],y1[2010],x2[2010],y2[2010],cnt=0,boom=0,l; 
int main(){
	//freopen("轰炸II.in","r",stdin);
	//freopen("轰炸II.out","w",stdout);
	cin>>m>>n;
	for(int i=0;i<m;i++)cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
	for(int i=0;i<n;i++){
		boom=0;
		cnt=0;
		cin>>x>>y;
		for(int j=0;j<m;j++){
			if(x1[j]>=x&&y1[j]>=y&&x2[j]<=x&&y2[j]<=y){
				l=j;
				cnt++;
				boom=1;
			}
		}
		if(boom)cout<<"YES "<<cnt<<" "<<l<<endl;
		else cout<"NO"<<endl;
	}
	return 0;
} 
2023/11/16 21:17
加载中...