题解:KDtree模板题 (犯了逻辑错误调了2个小时
#include #include #include #include #include #include #include #include #include #include
4066: 简单题
Time Limit: 50 Sec Memory Limit: 20 MB Submit: 5024 Solved: 1414 [ ][ ][ ] Description
你有一个N*N的棋盘,每个格子内有一个整数,初始时的时候全部为0,现在需要维护两种操作:
命令 | 参数限制 | 内容 |
1 x y A | 1<=x,y<=N,A是正整数 | 将格子x,y里的数字加上A |
2 x1 y1 x2 y2 | 1<=x1<= x2<=N 1<=y1<= y2<=N | 输出x1 y1 x2 y2这个矩形内的数字和 |
3 | 无 | 终止程序 |
Input
均要异或上一次输出的答案last_ans,初始时last_ans=0。
Output
Sample Input
4
1 2 3 3
2 1 1 3 3
1 1 1 1
2 1 1 0 7
3
Sample Output
HINT
1<=N<=500000,操作数不超过200000个,内存限制20M,保证答案在int范围内并且解码之后数据仍合法。
新加数据一组,但未重测----2015.05.24