Distances

AtCoder Beginner Contest 201 E - Xor Distances

# E - Xor Distances [原题链接](https://atcoder.jp/contests/abc201/tasks/abc201_e) 题意:设dist(i,j)即i到j之间路径的异或和,求树上所有两点之间dist(i,j)的和 思路:dist(i,j) = dist(i,1)^ ......
Distances Beginner AtCoder Contest 201

[CF1794E] Labeling the Tree with Distances 题解

# [CF1794E] Labeling the Tree with Distances 题解 ## 题目描述 给你一个树,边权为 $1$。给定 $n-1$ 个数,你需要将这些数分配到 $n-1$ 个节点上。 一个点 $x$ 是好的,当且仅当存在一种分配方案,所有被分配数的点到 $x$ 的最短路径长 ......
题解 Distances Labeling 1794E 1794

Tree Distances I

# Tree Distances I ## 思路 先考虑只算节点 $1$ 的答案,我们发现如果要每个节点都这么算一次的话,绝对会![image](https://img2023.cnblogs.com/blog/2903414/202308/2903414-20230815201329562-731 ......
Distances Tree

834. Sum of Distances in Tree (Hard)

Description 834. Sum of Distances in Tree (Hard) There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are g ......
Distances Hard Tree 834 Sum

[ABC201E] Xor Distances 题解

[Xor Distances](https://www.luogu.com.cn/problem/AT_abc201_e) ### 题目大意 给定一颗带边权无根树,定义 $\text{dis}(i,j)$ 表示 $i,j$ 两点在树上的最短路径的边权的异或和。求: $$\sum_{i=1}^n\su ......
题解 Distances 201E ABC 201
共5篇  :1/1页 首页上一页1下一页尾页