青叶


私信TA

用户名:15005097886

访问量:11361

签 名:

等  级
排  名 1943
经  验 2447
参赛次数 0
文章发表 28
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<cstdio>
#include<cstring>
using namespace std;
int map[1001][1001];

int main(){
	int n,m;
	scanf("%d",&n);
	memset(map, 0, sizeof(int)*100*100);
	
	int x,y;
	while(n--){
		scanf("%d %d",&x,&y);
		map[x][y]=1; 
	}
	
	int x1,y1,x2,y2;
	scanf("%d",&m);
	while(m--){
		scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
		int result=0;
		for(int i=x1; i<=x2; i++) for(int j=y1; j<=y2; j++){
			result+=map[i][j];
		}
		printf("%d\n",result);
	}
	return 0;
}


 

0.0分

2 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区

每输入一个问题后输出一个结果
不然编译会错
2021-02-08 17:32:23
每输入一个问题后输出一个结果
不然结果会错
2021-02-08 17:32:02
  • «
  • 1
  • »