1844G

CF1844G 题解

鉴定为学 MO 学的。 MO 中著名的《数学奥林匹克小丛书高中卷》的第十五本曾经讲过,如果原方程较难解,可以考虑给左右两边同时对 \(M\) 取模,然后研究取模以后的问题,其中 \(M\) 为一个根据问题选取的适当的整数。 我们看见这个问题觉得很烦,因为大家都能发现这个条件给的相当于 \(d_i+d ......
题解 1844G 1844 CF

CF1844G Tree Weights

[题面传送门](https://www.luogu.com.cn/problem/CF1844G) 这个真的很容易想到吗? 首先定 $1$ 为根,设每个点的深度是 $d_i$,则两个点之间的距离是 $d_{i}+d_{i+1}-2d_{LCA(i,i+1)}$。题目中相当于给出了 $n-1$ 个方程 ......
Weights 1844G 1844 Tree CF

题解 CF1844G【Tree Weights】

## problem 一棵树边带正整数权,给出所有 $dis(i,i+1)$,还原树的边权,或者无解。$n\leq 10^5,V\leq 10^{12}$。 ## solution 首先很容易得到 $n$ 个方程形如 $dep_1=0,dep_i+dep_{i+1}-2dep_{lca(i,i+1) ......
题解 Weights 1844G 1844 Tree

【CF1844G】Tree Weights

## 题目 题目链接:https://codeforces.com/contest/1844/problem/G 给定一棵 $n$ 个点的树,每条边有一个未知的正整数边权,给出 $d_i$ 表示点 $i$ 到点 $i+1$ 的距离,求出每条边的边权或判定无解。 $n\leq 10^5,d_i\leq ......
Weights 1844G 1844 Tree CF

CodeForces 1844G Tree Weights

[洛谷传送门](https://www.luogu.com.cn/problem/CF1844G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1844/G "CF 传送门") 出题人脑洞真大…… 设 $x_i$ 为 $i$ ......
CodeForces Weights 1844G 1844 Tree
共5篇  :1/1页 首页上一页1下一页尾页