轰炸II,50分求助
  • 板块灌水区
  • 楼主Ac_Code_cn_com
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/11/18 18:19
  • 上次更新2023/11/18 19:33:48
查看原帖
轰炸II,50分求助
1014410
Ac_Code_cn_com楼主2023/11/18 18:19
#include<bits/stdc++.h>
using namespace std;
long long m,n,x,y,x1[2010],y01[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]>>y01[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&&y01[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/18 18:19
加载中...