摘要: 题目:https://www.luogu.org/problemnew/show/P4220 http://uoj.ac/problem/347 先写了一下 n^2 和三棵树一样的情况,n^2 还写了ST表O(1)求 lca,其实做 n 遍 dfs 就好了... #include<cstdio> # 阅读全文
posted @ 2019-01-11 19:58 Zinn 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P4547 https://www.lydsy.com/JudgeOnline/problem.php?id=5006 参考博客:https://www.cnblogs.com/yanshannan/p/9452802 阅读全文
posted @ 2019-01-11 16:33 Zinn 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P4546 先写了个55分的部分分,直接用LCT维护即可,在洛谷上拿了60分; 注意各处 pushup,而且 splay 维护的是一条链但其形态不一定是一条链! #include<iostream> #include< 阅读全文
posted @ 2019-01-11 11:56 Zinn 阅读(187) 评论(0) 推荐(0) 编辑