摘要:
P4551最长异或路径 链接 "luogu" 思路 从$1$开始$dfs$求出$xor$路径。然后根据性质$x$到$y$的$xor$路径就是$xo[x]^xo[y]$ 代码 cpp include using namespace std; const int _=1e5+7; int xo[_],w 阅读全文
摘要:
cf1207解题报告 A 模拟 cpp include define ll long long using namespace std; ll T,a,b,c,x,y; int main() { cin T; while(T 0) { cin a b c x y; ll ans=0; if(x y) 阅读全文
摘要:
CF888G XOR MST 链接 "CF888G" 思路 trie上贪心,先左右两边连边,再用一条边的代价连起左右两颗树。因为内部的边一定比跨两棵树的边权笑,显然是对的。 代码自己瞎yy的。启发式合并 代码 cpp include define ll long long using namespa 阅读全文