随笔分类 -  数据结构-并查集

摘要:题面:https://www.luogu.org/problem/P1196 阅读全文
posted @ 2019-10-08 19:34 prestige 阅读(133) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P1955 cpp 本题可以把等于的并在一起,碰到不等于的就判断是否矛盾。由于数据比较大,注意要离散化。 Code: include include include include include include in 阅读全文
posted @ 2019-07-16 15:04 prestige 阅读(155) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P1892 cpp 本题可以把朋友并在一起,用一个数组记录敌人,然后把敌人的敌人和自己并在一起即可。 Code: include include include include include include incl 阅读全文
posted @ 2019-07-16 15:04 prestige 阅读(110) 评论(0) 推荐(0)
摘要:```cpp // 初始化n个元素 void init(int n) { for(int i=0;i 阅读全文
posted @ 2019-07-16 13:41 prestige 阅读(267) 评论(0) 推荐(0)