摘要: https://www.luogu.com.cn/problem/P2820 菜题一天做一道还是太浪费时间了 最小生成树,输入数据保证边权为正 但是原始图可能不连通,生成树要保证图的不连通性 问题不大,建立"超级父亲"就行了(假,见注) 不对,求最小生成树不会加原本没有的边,所以不会更改原图的连通性 阅读全文
posted @ 2022-12-28 18:43 antimo 阅读(22) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1547 最小生成树中的最长边是最后被加入的 #include<bits/stdc++.h> using namespace std; #define in Read() typedef long long ll; int in{ 阅读全文
posted @ 2022-12-23 16:51 antimo 阅读(27) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P2872 数据范围不大,所以可以暴力处理图,然后用最小生成树 已经加进去的边不可能再加一次了,并查集会自动把他们筛掉 调试的时候一直不出答案,很离谱 最终发现是因为没有输入n和m。。。。。 然后数组开小了,改对了就没问题了 #inc 阅读全文
posted @ 2022-12-21 17:06 antimo 阅读(19) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1546 一遍过 #include<bits/stdc++.h> using namespace std; #define in Read() typedef long long ll; int in{ int i=0,f=1; c 阅读全文
posted @ 2022-12-20 17:33 antimo 阅读(40) 评论(0) 推荐(0)
摘要: 黄题,简单 阅读全文
posted @ 2022-12-19 20:52 antimo 阅读(23) 评论(0) 推荐(0)
摘要: 鸽王回来写题了 阅读全文
posted @ 2022-12-18 15:07 antimo 阅读(19) 评论(0) 推荐(0)
摘要: 咕 阅读全文
posted @ 2022-12-01 20:18 antimo 阅读(28) 评论(0) 推荐(0)
摘要: 蒟蒻最不该翘课了 阅读全文
posted @ 2022-11-23 21:59 antimo 阅读(40) 评论(0) 推荐(0)
摘要: 观察性质!! 阅读全文
posted @ 2022-11-20 16:16 antimo 阅读(26) 评论(0) 推荐(0)
摘要: 单个变量修改,如果要在函数中修改而主函数中相应地改变,用&就完事了 但如果想修改一个数组呢? 只需要传址的时候传入数组的头指针就可以了 见下,一看就懂(本人语文从高考后就不太行了,还是直接看代码好懂) #include<bits/stdc++.h> using namespace std; #def 阅读全文
posted @ 2022-11-20 00:04 antimo 阅读(133) 评论(0) 推荐(0)