摘要:
代码: int e[50][50]; int cnt[N], group[N], sta[N], ans; int n; bool dfs(int u, int deep){ for(int i = u + 1; i <= n; ++i){ if(cnt[i] + deep <= ans) retu 阅读全文
摘要:
Big Secret 题解: 若 cur ^ x > cur 则 x2进制下最高位的1 所对应cur的那个位置是0, 否则数字一定变小。 我们可以将每个数的最高位找出来。 然后我们从低位去check某位是不是0。 虽然对于每个数来说都只要考虑最高位就好了, 但是相对的最高位会影响比他低位置的数, 低 阅读全文
摘要:
Kuro and GCD and XOR and SUM 题解: 对于每个值先找到所有的因子。 然后每次add的时候,在他的所有因子都加入这个数。 然后询问的时候询问这个数的因子所构成的字典树。 代码: #include<bits/stdc++.h> using namespace std; #de 阅读全文
摘要:
Time to Raid Cowavans 题意: 询问 下标满足 a + b * k 的和是多少。 题解: 将询问分块。 将b >= blo直接算出答案。 否则存下来。 存下来之后,对于每个b扫一遍数组,然后同时处理相同b的询问。 代码: #include<bits/stdc++.h> using 阅读全文