
codeforces
xzw777_
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #406 (Div. 2) D. Legacy
D. LegacyRick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad guys catch them.There are n planets in t...原创 2018-02-18 23:13:38 · 300 阅读 · 0 评论 -
Codeforces Round #416 (Div. 2) E. Vladik and Entertaining Flags (线段树+并查集)
题目链接:传送门 题目描述:相邻两块颜色相同为同一块,问给定区间内有多少连通块 题解: 很容易想到用线段树做,然后用并查集实现连通块判定。 build时对每一个块进行编号,并且同列相邻合并(给同一编号),然后考虑横向合并(at:此时两个竖向合并已完成),横向合并就简单啦:直接左右儿子编号对应的L,R丢并查集,左右两块交界处就是mid和mid+1,a[i][mid原创 2018-03-02 13:38:26 · 216 阅读 · 0 评论