HDU 3584 Cube】的更多相关文章

HDU - 3584 Cube Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit Status Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. I…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3584 Cube Problem Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. Initially we have A[i, j, k] = 0 (1 <= i, …
Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1949    Accepted Submission(s): 1013 Problem Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the numbe…
Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1166    Accepted Submission(s): 580 Problem Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number…
Problem Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. Initially we have A[i, j, k] = 0 (1 <= i, j, k <= N). We define two operations, 1: "Not"…
题意:给一个三维数组n*n*n,初始都为0,每次有两个操作: 1. 翻转(x1,y1,z1) -> (x2,y2,z2) 0. 查询A[x][y][z] (A为该数组) 解法:树状数组维护操作次数,一个数被操作偶数次则相当于没被操作. 每次更新时在8个位置更新: .相当于8个二进制数:000,001,010,011,100,101,110,111. (我是由二维推过来的) 其实不用有的为-1,直接1也行,因为反正会改变奇偶性. 代码: #include <iostream> #inclu…
题目大意:给定一个体积为N*N*N立方体,每个单位小立方体A[x][y][z]里有一个值,初始值全部为0,我们可以对立方体进行一下两种操作: 0表示查询A[x][y][z]的奇偶性 1表示对子立方体的每个元素的值进行增减 题解:首先显然是三维的树状数组,然后对于区间的修改,可以用前缀和来解决,在起点改变一下,终点的后一位改变一下即可. #include <cstring> #include <cstdio> #define N 105 using namespace std; in…
题意:还是那篇论文里面讲到的,三维树状数组http://wenku.baidu.com/view/1e51750abb68a98271fefaa8画个立方体出来对照一下好想一点 #include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<stack> #include<vector> #include<map> #inclu…
Cube number on a tree Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1628    Accepted Submission(s): 382 Problem Description The country Tom living in is famous for traveling. Every year, man…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1220 Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2627    Accepted Submission(s): 2064 Problem Description Cowl is good at solving math pro…