社区讨论

轰炸II,50分求助

灌水区参与者 1已保存回复 0

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
0 条
当前快照
1 份
快照标识符
@lp3wdlop
此快照首次捕获于
2023/11/18 18:19
2 年前
此快照最后确认于
2023/11/18 19:33
2 年前
查看原帖
C
#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;
} 

回复

0 条回复,欢迎继续交流。

正在加载回复...