Problem Description John is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage large amounts of products, every processor has a serial number. More specifically, the factory produces n chips today, the i-th chip p…
Chip Factory http://acm.hdu.edu.cn/showproblem.php?pid=5536 Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 280 Accepted Submission(s): 158 Problem Description John is a manager of a CPU c…
给一个序列,每次操作对这个序列中的所有数异或一个x,问每次操作完以后整个序列的mex值. 做法是去重后构建01字典树,异或x就是对root加一个x的lazy标志,每次pushDown时如果lazy的这一位是1,则交换左右儿子.找mex的话只要每次往左走,如果左子树是满的,则往右走,并且加上左边相应造成的贡献.具体见代码: #include <bits/stdc++.h> using namespace std; ; typedef long long ll; int n, m; struct…