随笔分类 -  DFS

摘要:分析 求出直径和最远距离d 之后我们以直径中点为根 发现父亲的d肯定不小于儿子的d 于是从下往上启发式合并维护与子树根的值相差L内的个数即可 代码 #include<bits/stdc++.h> using namespace std; #define fi first #define se sec 阅读全文
posted @ 2019-11-08 15:15 水题收割者 阅读(183) 评论(0) 推荐(0)
摘要:分析 一个连通块内的肯定不影响 于是我们先缩点 之后对于每个路径 向上向下分别开一个差分数组 如果两个数组同时有值则不合法 代码 #include<bits/stdc++.h> using namespace std; int n,m,q,bl[200100],s[200100],t[200100] 阅读全文
posted @ 2019-11-08 15:06 水题收割者 阅读(181) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-11-08 14:54 水题收割者 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-11-08 14:38 水题收割者 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-11-08 14:36 水题收割者 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-10-30 14:12 水题收割者 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-10-29 14:20 水题收割者 阅读(1) 评论(0) 推荐(0)
摘要:分析 一层一层把叶子去掉 看最多能去掉多少层即可 代码 阅读全文
posted @ 2019-09-30 11:19 水题收割者 阅读(166) 评论(0) 推荐(0)
摘要:分析 https://yhx-12243.github.io/OI-transit/records/uoj356%3Bloj2391%3Bac2534.html 代码 阅读全文
posted @ 2019-09-30 11:03 水题收割者 阅读(611) 评论(0) 推荐(0)
摘要:分析 代码(我的代码是瞎jb水过去的) 阅读全文
posted @ 2019-09-30 10:33 水题收割者 阅读(353) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-09-30 09:00 水题收割者 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-09-30 08:26 水题收割者 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-09-01 09:52 水题收割者 阅读(3) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-09-01 09:09 水题收割者 阅读(1) 评论(0) 推荐(0)
摘要:分析 树上从下往上线性基合并即可 并不需要启发式/xyx 代码 阅读全文
posted @ 2019-08-24 19:39 水题收割者 阅读(121) 评论(0) 推荐(0)
摘要:分析 预处理出所有合法数字 然后直接lower_bound查询即可 代码 阅读全文
posted @ 2019-08-24 19:08 水题收割者 阅读(151) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-08-18 21:02 水题收割者 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-08-16 21:39 水题收割者 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-07-26 07:14 水题收割者 阅读(3) 评论(0) 推荐(0)
摘要:传送门 分析 我们考虑一个点有多少中情况可以被删除 我们发现只有删除它自己和删祖先共$dep_i$中 所以每个点的答案就是$\frac{1}{dep_i}$ 代码 阅读全文
posted @ 2019-03-27 11:23 水题收割者 阅读(133) 评论(0) 推荐(0)