摘要:
A. Math Problem $solution:$ 直接找右端点最小值与左端点的最大值做差比较即可,时间复杂度 $O(n)$ 。 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define i 阅读全文
摘要:
AGC014 E Blue and Red Tree link $solution:$ 考虑题目的性质,可以发现蓝树与红树肯定有交,且必在最后一次割掉。 所以考虑反向过程,如何从红树变为蓝树。 将最后一次的情况往外推广,每一次也要有类似的交集,。 考虑如何去维护,通过启发式合并 $set$ 与并查集 阅读全文