摘要: code: #include <bits/stdc++.h> #define N 100004 #define ll long long #define setIO(s) freopen(s".in","r",stdin) using namespace std; ll S; ll val[N],d 阅读全文
posted @ 2019-11-10 20:27 EM-LGH 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 我们发现正着枚举删除哪些叶子是错的,但是贪心枚举留下哪些却是对的. 我们枚举的时候需要动态查一个点到根有几个点没染色,和动态染色. 支持这些操作的数据结构非 LCT 莫属 code: #include <bits/stdc++.h> #define N 1000004 #define lson t[ 阅读全文
posted @ 2019-11-10 18:35 EM-LGH 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 联赛前练练码力. code: #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #define N 200006 #define ll long long #define lson t[x].ch[ 阅读全文
posted @ 2019-11-10 10:59 EM-LGH 阅读(252) 评论(0) 推荐(0) 编辑