随笔分类 - 字典树
摘要:Remember the Word
阅读全文
摘要:题意:给定$a[1...n]$,求$(a_i⊕a_i+1⊕...⊕a_j)+(a_p⊕a_{p+1}⊕...⊕a_{q})$的最大值,其中$1≤i≤j= 0; k ){ c=((x k)&1); if(!ch[now][c]){ ch[tot][0]=ch[tot][1]=0; sz[tot]=0;
阅读全文
摘要:```C++ /*H E A D*/ struct Trie{ int son[maxn>i)&1; rrep(i,32,0){ if(!son[now][b[i]]){ son[now][b[i]]=++tot; son[tot][0]=son[tot][1]=0; ...
阅读全文
摘要:```C++ / H E A D / struct Trie{ int son[maxn i)&1; rrep(i,32,0){ if(!son[now][b[i]]){ son[now][b[i]]=++tot; son[tot][0]=son[tot][1]=0; } now=son[now][
阅读全文
摘要:异或关于前缀的特性:[u,v]=[1,u]^[1,v] 注意是路径,假设1为根,prexor[1]不保留数值 C++ / H E A D / int to[maxn =1; } rrep(i,31,0){ if(!son[now][b[i]]) son[now][b[i]]=++tot; now=s
阅读全文