做法:我们考虑前缀异或和,修改操作就变成了区间[i,n]都异或x 查询操作就变成了:区间[1,x]中有几个k 显然的分块,每个块打一个tag标记表示这个块中所有的元素都异或了tag[x] 然后处理出这个块中每种数的个数 注意查询的时候零散的块要下放标记 代码: #include<bits/stdc++.h> #define N 100005 #define M 334 using namespace std; int cnt[M][N*14],sum[N],tag[M],ll[M],rr[M]…
地址:http://codeforces.com/contest/872/problem/D 题目: D. Something with XOR Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output This is an interactive problem. Jury has hidden a permutati…
[CODECHEF]Chef and Churus Description 有一个长度为\(n\)的数组\(A\),有\(n\)个函数,第\(i\)个函数的值为\(\sum_{j=l_i}^{r_i}A_j\) 有两种操作: ①修改\(A_i\) ②询问第\(l\)~\(r\)个函数值的和. Input First Line is the size of the array i.e. N Next Line contains N space separated numbers Ai denoti…
Chef and The Right Triangles The Chef is given a list of N triangles. Each triangle is identfied by the coordinates of its three corners in the 2-D cartesian plane. His job is to figure out how many of the given triangles are right triangles. A right…