UVA12716 GCD XOR Description Given an integer N, find how many pairs (A, B) are there such that: gcd(A, B) = A xor B where 1 ≤ B ≤ A ≤ N. Here gcd(A, ...
分类:
其他好文 时间:
2018-09-04 20:49:53
阅读次数:
167
Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。 Input 第一行两个整数N,M。 第二行有N个整数,其中第i个整数 ...
分类:
其他好文 时间:
2018-09-03 19:35:01
阅读次数:
149
任意门:http://codeforces.com/problemset/problem/617/E E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input ...
分类:
编程语言 时间:
2018-08-31 01:25:10
阅读次数:
250
一道稍微要点脑子的莫队题,~~原来省选也会搬CF原题~~ 首先利用$xor$的性质,我们可以搞一个 异或前缀和 的东西 每一次插入一个数,考虑它和之前已经加入的数能产生多少贡献,这个我们再开一个数据统计一下 出现次数 。 但是唯一要注意的就是一些细节问题,尤其是左端点加入(or删除)的时候要减一 然 ...
分类:
其他好文 时间:
2018-08-29 22:19:34
阅读次数:
215
"题目传送 Luogu4717" 题意: 给你$A$,$B$,求$$C_i=\sum_{j\oplus k=i}A_j B_k $$ $\oplus$包括$or$,$and$,$xor$ $len\le 2^{17}$ 题解: 裸的$FWT$,总结先留坑 过程: 一切顺利 代码: const int ...
分类:
其他好文 时间:
2018-08-29 21:28:57
阅读次数:
219
XOR-pyramid time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output XOR-pyramid time limit per t ...
分类:
其他好文 时间:
2018-08-28 16:15:01
阅读次数:
182
Description In an edge-weighted tree, the xor-length of a path p is defined as the xor sum of the weights of edges on p: ⊕ is the xor operator. We say ...
分类:
其他好文 时间:
2018-08-23 22:17:50
阅读次数:
261
#include using namespace std; #define ll long long const ll maxn = 3e5+5; const ll mod = 1e9+7; ll n; ll a[maxn], b[maxn]; void fwt(ll *a) { for(ll d=... ...
分类:
其他好文 时间:
2018-08-23 15:39:07
阅读次数:
156
图片xor的脚本 和图片进行xor or and 运算的脚本 ...
分类:
其他好文 时间:
2018-08-23 02:04:40
阅读次数:
179
FWT 是求多项式位元算卷积的一种高效方法 最常见的有 or、and、xor 这三种操作 void FWT(LL f[], int n, int op) { int mx = 0; while((1LL<<mx) < n) mx++; for (int i = 1; i <= mx; ++i) { ...
分类:
其他好文 时间:
2018-08-20 13:44:48
阅读次数:
171