摘要: 传送门 求补图的联通块个数。 补图非常大。 链表维护搜索。 把所有点加到链表中,每次取出链头,删掉,联通块个数++;扔进队列,取出队首,把原图跟他有连边的标记了,遍历一遍链表把没有标记的删除,入队,继续取出队首重复。 RE了半个下午发现建图边开小了。。 //Achen #include<algori 阅读全文
posted @ 2017-12-16 07:17 啊宸 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 左偏树。 每个子节点维护大根堆,遍历一个儿子就往自己合并,合并发现钱不够了就删除队顶。 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #inclu 阅读全文
posted @ 2017-12-16 07:11 啊宸 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 左偏树裸题。 题面描述让人意识到了平面几何的重要性。 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> #inclu 阅读全文
posted @ 2017-12-16 07:10 啊宸 阅读(159) 评论(0) 推荐(0) 编辑