hdu 3584
来源:互联网 发布:大灰狼8.78钻石版源码 编辑:程序博客网 时间:2024/05/16 01:07
OJ
#include <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <vector>#include <map>#include <set>#include <string>#include <cstring>#include <list>#include <queue>#include <stack>#include <cmath>using namespace std;#define PF(x) (scanf("%d",&x))#define PT(x,y) (scanf("%d%d",&x,&y))#define PR(x) (printf("%d\n",x))#define PRT(x,y)(printf("%d %d\n",x,y))#define M 105int arr[M][M][M];int n,m;int maxx(int x,int y){return x>y?x:y;}int minx(int x,int y){return x>y?y:x;}int low(int x){return x&(-x);}void add(int x,int y,int z,int c){int t=y;int tt = z;for(x;x<M;x+=low(x))for(t = y;t<M;t+=low(t))for(tt = z;tt<M;tt+=low(tt))arr[x][t][tt]+=c;}int sums(int x,int y,int z){int sumt = 0;int t;int tt;for(;x;x-=low(x))for(t=y;t;t-=low(t))for(tt = z;tt;tt-=low(tt))sumt += arr[x][t][tt];return sumt;}void init(){int q;while(scanf("%d%d",&n,&m)!=EOF){memset(arr,0,sizeof(arr));char ch[10];int x,y,z,xx,yy,zz;for(int i=0;i<m;i++){scanf("%s",ch);if(ch[0] == '1'){scanf("%d%d%d%d%d%d",&x,&y,&z,&xx,&yy,&zz);add(x,y,z,1);xx++,yy++,zz++;add(xx,y,z,-1);add(x,yy,z,-1);add(x,y,zz,-1);add(xx,yy,z,1);add(xx,y,zz,1);add(x,yy,zz,1);add(xx,yy,zz,-1);}else {scanf("%d%d%d",&x,&y,&z);printf("%d\n",sums(x,y,z)%2?1:0);}}}return ;}int main(){init();return 0;}
- hdu 3584
- hdu 3584 Cube
- hdu 3584 Cube
- HDU 3584 Cube
- hdu 3584 Cube
- HDU 3584 树状数组
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- 64位UbuntuLinux环境下搭建Elicpse
- 毕业一年的女程序员生活
- 移动互联网创业机会只剩3年
- 回旋矩阵的构建方法
- 安德森:现在创业就好比1999 第二个黄金时代来袭
- hdu 3584
- FND_REQUEST.SUBMIT_REQUEST in R12
- springmvc develop
- java filter 读取 filter init-param 配置的变量
- 使用TableDiff实用工具解决事务复制中的问题
- as3xls开源项目的中文乱码问题 转载
- Android Gallery图片一张张滑动
- Java中的继承、封装、多态
- Android屏蔽home键