地址: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…
做法:我们考虑前缀异或和,修改操作就变成了区间[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]…
XOR and Favorite Number time limit per test: 4 seconds memory limit per test: 256 megabytes input: standard input output: standard output Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pa…
E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pai…