纠结的二维数组 Matrix
来源:互联网 发布:泡妞宝鉴天地知我心txt 编辑:程序博客网 时间:2024/06/05 02:55
其实对于Matrix 我很喜欢看的一部电影《黑客帝国》...兴致勃勃的去做,哎~可惜却是我最痛恨的英文...
蛋疼...黑客帝国Matrix VS zion 确实很不错...我弄了个电子版程序介绍,不错的哦~有兴趣的朋友可以去我空间日志去看看。
http://user.qzone.qq.com/504281906/infocenter
废话不多说,哎~最近逻辑混乱了,说话打字颠三倒四的...
#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <cmath>#include <algorithm>using namespace std;int n,m,ans;int a[1010][1010];void sum(int x,int y){while (x<=n){int y1=y;while (y1<=n){a[x][y1]^=1;y1+=(y1 & -y1);}x+=(x & -x);}}void update(int x,int y,int x1,int y1){sum(x,y);sum(x1+1,y);sum(x,y1+1);sum(x1+1,y1+1);}void answer(int x,int y){ans=0;while (x>0){int y1=y;while (y1>0){ans= (ans+a[x][y1])&1;y1-=(y1 & -y1);}x-=(x & -x);}ans&=1;printf("%d\n",ans);}int main(){int T;scanf("%d",&T);while (T--){scanf("%d%d",&n,&m);memset(a,0,sizeof(a)); while (m--){char c[2];scanf("%s",&c);if (c[0]=='C'){int x,x1,y,y1;scanf("%d%d%d%d",&x,&y,&x1,&y1);getchar();update(x,y,x1,y1);}else {int x,y;scanf("%d%d",&x,&y);getchar();answer(x,y);}}cout<<endl;}return 0;}
- 纠结的二维数组 Matrix
- POJ2155 Matrix 二维树状数组的应用
- Matrix(二维树状数组)
- B. Matrix(二维树状数组)
- poj2155--Matrix--二维树状数组
- POJ2155 Matrix(二维树状数组)
- poj2155 Matrix 【二维树状数组】
- poj2155~Matrix~二维树状数组!
- POJ2155 Matrix 二维树状数组
- poj2155 Matrix 【二维树状数组】
- 【poj2155】【二维树状数组】Matrix
- poj2155 Matrix 二维树状数组
- [POJ2155] Matrix - 二维树状数组
- 【POJ2155】Matrix(二维树状数组)
- POJ2155-Matrix-二维树状数组
- poj2155 Matrix 二维树状数组
- poj2155 Matrix 二维树状数组
- POJ2155-二维树状数组-Matrix
- 动态生成二维数组...
- 栈...
- 栈与队列....
- 树状数组解决敌兵布阵~~
- Japan 树状数组加逆序数...
- 纠结的二维数组 Matrix
- 二维数组解决矩阵相加...
- Another Very Easy Task 我也不知道怎么会过不了?
- 1487: 未覆盖顶点数量.
- SPOJ:416 Divisibility by 15
- 最小生成树之Swordfish
- 哎~水题,还是最小生成树。没想到一遍AC了...
- 最小生成树,继续水~
- 并查集~