摘要: 800年没写DP了,一个傻逼题调半天. code: #include <cstdio> #include <cstring> #include <algorithm> #define N 504 #define inf -10000 #define setIO(s) freopen(s".in"," 阅读全文
posted @ 2019-12-26 20:34 EM-LGH 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 推式子没推出来什么特别有用的结论. 看题解后发现这尼玛就是一个大爆搜啊. 以后碰到这种推式子推不出来,或者没啥思路的时候可以考虑爆搜解决. code: #include <cstdio> #include <string> #include <cstring> #include <algorithm 阅读全文
posted @ 2019-12-26 16:46 EM-LGH 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 这个和 QTREE5 的套路是一样的,就是维护一个深度最深/浅的距离和,然后合并一下就好了. code: #include <map> #include <string> #include <cstdio> #include <cstring> #include <algorithm> #defin 阅读全文
posted @ 2019-12-26 14:57 EM-LGH 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 注意:$LCT$ 在 $link$ 的时候必须要 makeroot. 假如要将 $y$ 连到 $x$ 上: 如果只是将 $y$ Access 并 splay 然后直接连到 $x$ 上的话你会发现 $y$ 在 $splay$ 中所有左儿子其实都在 $(x,y)$ 之间,而这显然就不对了. code: 阅读全文
posted @ 2019-12-26 11:53 EM-LGH 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 对与每一个时刻用主席树维护一下 DFS 序即可. LCA 的话树剖求解比较快. code: #include <cstdio> #include <string> #include <cstring> #include <algorithm> #define N 200006 using names 阅读全文
posted @ 2019-12-26 09:35 EM-LGH 阅读(118) 评论(0) 推荐(0) 编辑