随笔分类 -  位运算

1
摘要:【FOTILE模拟赛】L 阅读全文
posted @ 2018-08-13 02:57 Caturra 阅读(196) 评论(0) 推荐(0)
摘要:Alo 阅读全文
posted @ 2018-08-13 00:54 Caturra 阅读(137) 评论(0) 推荐(0)
摘要:小Hi的烦恼 阅读全文
posted @ 2018-08-06 12:05 Caturra 阅读(201) 评论(0) 推荐(0)
摘要:farm 阅读全文
posted @ 2018-07-21 23:48 Caturra 阅读(267) 评论(0) 推荐(0)
摘要:无效位置 阅读全文
posted @ 2018-05-01 20:33 Caturra 阅读(180) 评论(0) 推荐(0)
摘要:Gambling Nim 阅读全文
posted @ 2018-05-01 05:28 Caturra 阅读(191) 评论(0) 推荐(0)
摘要:albus就是要第一个出场 阅读全文
posted @ 2018-05-01 03:41 Caturra 阅读(160) 评论(0) 推荐(0)
摘要:Xor 阅读全文
posted @ 2018-05-01 02:30 Caturra 阅读(240) 评论(0) 推荐(0)
摘要:XOR 阅读全文
posted @ 2018-04-30 13:45 Caturra 阅读(224) 评论(0) 推荐(0)
摘要:To xor or not to xor 阅读全文
posted @ 2018-04-29 18:36 Caturra 阅读(189) 评论(0) 推荐(0)
摘要:Substrings in a String 阅读全文
posted @ 2018-04-20 19:46 Caturra 阅读(110) 评论(0) 推荐(0)
摘要:题意:给定$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; 阅读全文
posted @ 2018-02-08 01:24 Caturra 阅读(180) 评论(0) 推荐(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; ... 阅读全文
posted @ 2018-02-08 00:53 Caturra 阅读(109) 评论(0) 推荐(0)
摘要:```C++ / H E A D / int main(){ int T=read(); while(T ){ ll a=read(); ll b=read(); ll c=read(); ll d=read(); ll ans=0; ll x=0,y=0; rrep(i,61,0){ bool p 阅读全文
posted @ 2018-02-07 23:57 Caturra 阅读(122) 评论(0) 推荐(0)
摘要:我对莫队算法最为纠结的地方就是区间端点处,应该是像代码里那样理解吧 cnt[i]表示i出现的次数 maxn开2e6比较保险 阅读全文
posted @ 2018-02-07 22:06 Caturra 阅读(175) 评论(0) 推荐(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][ 阅读全文
posted @ 2018-02-07 15:47 Caturra 阅读(104) 评论(0) 推荐(0)
摘要:依然是异或运算,这次是限制L,R范围内挑2个数使其异或值最大 如果r最高为是pos,那最理想状态当然是(1ll l r){ if(l r) swap(l,r); if(l==r){ cout i)&1){ pos=i; break; } } coutj k 0),无论如何异或,2^i是无效的,这时的 阅读全文
posted @ 2018-02-07 01:45 Caturra 阅读(129) 评论(0) 推荐(0)
摘要:求[1,n]内k的值的异或和使其值最大 k=1是肯定是n k 1,设pos是n的最高位,那答案就是(1ll 阅读全文
posted @ 2018-02-07 01:20 Caturra 阅读(206) 评论(0) 推荐(0)
摘要:异或关于前缀的特性:[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 阅读全文
posted @ 2018-02-07 00:12 Caturra 阅读(163) 评论(0) 推荐(0)

1