随笔分类 - 算法—dsu on tree
摘要:D. Tree Requests http://codeforces.com/problemset/problem/570/D 题意: 一个以1为根的树,每个点上有一个字母(a-z),每次询问一个子树内深度为h的点是否可以构成回文串。(深度是到1的深度,没有也算,空回文串) 分析: dsu on t
阅读全文
摘要:D. Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths http://codeforces.com/problemset/problem/741/D 题意: 一棵根为1 的树,每条边上有一个字符(a-v共22种)。 求每个子树内的最
阅读全文
摘要:E. Lomsat gelral http://codeforces.com/contest/600/problem/E 题意: 求每个子树内出现次数最多的颜色(如果最多的颜色出现次数相同,将颜色编号求和)。 分析: dsu on tree。 这个可以解决一系列不带修改的子树查询问题。 考虑暴力的思
阅读全文

浙公网安备 33010602011771号