题目链接 \(Description\) 有一张\(n\)个点的完全图,每个点的权值为\(a_i\),两个点之间的边权为\(a_i\ xor\ a_j\)。求该图的最小生成树。 \(n\leq2*10^5,0\leq ai<2^{30}\)。 \(Solution\) 代码好神 ...
Discription Ehab is interested in the bitwise xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting ofnvertices numbered from ton . Fo ...
2018-04-14 20:20 4 583 推荐指数:
题目链接 \(Description\) 有一张\(n\)个点的完全图,每个点的权值为\(a_i\),两个点之间的边权为\(a_i\ xor\ a_j\)。求该图的最小生成树。 \(n\leq2*10^5,0\leq ai<2^{30}\)。 \(Solution\) 代码好神 ...
链接 [https://codeforces.com/contest/1174/problem/D] 题意 让你构造一个数组,使得任意子段异或和不为0也不为x,而且每个数字大于等于1小于(1<<n) 分析 比赛做不出来,还是太垃圾了,这只能说水平不够。而且我对位运算的题真的 ...
Description 题库链接 给你一张 \(n\) 个点的完全图,其中有 \(m\) 条边长度为 \(1\),其余全为 \(0\)。问你这张图的最小生成树为多少。 \(1\leq n\leq ...
D. 0-1 MST Ujan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. ...
题意: 定义一个函数f(a): 给出一个数组a,有q个询问,每次询问回答在l到r的区间内,连续子串的f函数的最大值。 思路: 画图,来自codeforces SheepRanger 由此图可知,f(l,r) = f(l,r-1) ^ f(l+1,r),多画图哇! 所以就变成 ...
E. Danil and a Part-time Job time limit per test 2 seconds memory limit per test 256 megabytes input ...
我们把所有点分成四类 $A_{0,0},A_{0,1},A_{1,0},A_{1,1}$ 发现如果$A_{0,0}+A_{1,1} > 0$并且$A_{0,1}+A_{1,0} > 0 ...
传送门 这是一道英语题,首先要读懂题目: $\text{Alex believes that his trip will be interesting only if he will not us ...