做题记录 25.5.23
\(\textcolor{blue}\odot\) CF920E Connected Components?
找出度数最小的点 \(u\),显然其度数不超过 \(\left\lfloor\frac {2m}n\right\rfloor\),在补图上它和至少 \(n-1-\left\lfloor\frac {2m}n\right\rfloor\) 个点有连边,将这 \(n-\left\lfloor\frac {2m}n\right\rfloor\) 个点并为一个连通块,连通块外的点暴力枚举补图上的边并合并连通块,时间复杂度 \(O(m\alpha(n)+n\log n)\),容易做到 \(O(m\alpha(n)+n)\)
\(\textcolor{purple}\odot\) CF916D Jamie and To-do List
用两棵可持久化线段树即可,时空复杂度 \(O(q\log q)\)

浙公网安备 33010602011771号