随笔分类 -  dfs 树

摘要:洛谷传送门 AtCoder 传送门 喵喵题。 考虑若所有点权都已确定,如何求 1n 所有路径权值和的 gcd。 考虑如何 check 一个 x 是否合法。考虑拆点,把点权转成边权,在新图上连边 uu,边权 au;\(u' \to 阅读全文
posted @ 2023-11-22 18:33 zltzlt 阅读(12) 评论(0) 推荐(0) 编辑
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1364D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1364/D "CF 传送门") 简单题。 特判掉 m=n1 的情况 阅读全文
posted @ 2023-07-12 08:10 zltzlt 阅读(30) 评论(0) 推荐(0) 编辑
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc306_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc306/tasks/abc306_g "AtCoder 传送门") 考虑若干个能被 $ 阅读全文
posted @ 2023-06-18 10:42 zltzlt 阅读(169) 评论(8) 推荐(0) 编辑

点击右上角即可分享
微信分享提示