摘要:用了很神奇的办法,对于每一个数,取反,暴力找它所有子集,如果dfs到的数字又是我们输入的数字,就继续取反暴力找子集 #include <bits/stdc++.h> using namespace std; const int N = (1 << 23) + 10; int a[N]; bool v
阅读全文
摘要:很容易想到离线的做法,倍增往上找,然后整个dfs一遍,但是需要用到树状数组 顺便,求log2(x)千万别写log(x) / log(2),精度会出问题,直接写log2(x)就行了 #include <bits/stdc++.h> using namespace std; const int N =
阅读全文