poj1656
来源:互联网 发布:如何看待知乎live 编辑:程序博客网 时间:2024/06/05 12:01
水的不能再水。
#include <iostream>#include <cstdio>#include <string>#include <map>#include <string.h>int flag[101][101]= {0};int n,x,y,l;int num;char s[10];using namespace std;int main(){ //freopen("in.txt","r",stdin); scanf("%d",&n); while(n--) { scanf("%s",s); if(!strcmp(s,"BLACK")) { scanf("%d%d%d",&x,&y,&l); for(int i=x; i<=x+l-1; i++) for(int j=y; j<=y+l-1; j++) flag[i][j]=1; } else if(!strcmp(s,"WHITE")) { scanf("%d%d%d",&x,&y,&l); for(int i=x; i<=x+l-1; i++) for(int j=y; j<=y+l-1; j++) flag[i][j]=0; } else if(!strcmp(s,"TEST")) { num=0; scanf("%d%d%d",&x,&y,&l); for(int i=x; i<=x+l-1; i++) for(int j=y; j<=y+l-1; j++) { if(flag[i][j]==1) num++; } printf("%d\n",num); } }}
0 0
- POJ1656
- poj1656
- POJ1656
- poj1656
- poj1656
- POJ1656
- poj1656
- poj1656----二维线段树
- poj1656 Counting Black
- poj1656 二维树状数组
- POJ1656 Counting Black [简单暴力]
- 北大ACM poj1656 Counting Black
- poj1656作为新手我都觉得水!!
- 白色网格统计poj1656-Counting Black
- AngularJs中directive详解
- iOS开发之蓝牙总结
- Python-ORM-SQLALchemy
- Groory(二) 字符串String+集合Collection篇---极速入门总结
- Execution failed for task ':app:clean'.
- poj1656
- 原因:安装MySQL-python-1.2.3.win-amd64-py2.7.exe,时提示:Python version 2.7 required, which was not found in
- WebLogic 12c 中使用Xfire/axis2时,创建客户端总是报类名空间冲突的错误
- 机房收费系统之初认识
- Flume整合HDFS
- Linq语法详细
- 商品ElasticSearch的查询改造
- 手把手教你玩转酷炫CSS3 3D技术!
- 集合Bootstrap自定义confirm