随笔分类 - dfs 树
摘要:洛谷传送门 AtCoder 传送门 喵喵题。 考虑若所有点权都已确定,如何求 \(1\) 到 \(n\) 所有路径权值和的 \(\gcd\)。 考虑如何 check 一个 \(x\) 是否合法。考虑拆点,把点权转成边权,在新图上连边 \(u \to u'\),边权 \(a_u\);\(u' \to
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1364D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1364/D "CF 传送门") 简单题。 特判掉 $m = n - 1$ 的情况
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc306_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc306/tasks/abc306_g "AtCoder 传送门") 考虑若干个能被 $
阅读全文

浙公网安备 33010602011771号