摘要: 【算法竞赛】一些好用的模版/注意要点 火车头(2025.10.03更新) #include<bits/stdc++.h> using namespace std; #define endl '\n' #define whiteink signed main #define fi first #def 阅读全文
posted @ 2025-01-12 15:56 White_ink 阅读(34) 评论(0) 推荐(0)
摘要: 【Kruskal算法】 模版题 https://www.acwing.com/file_system/file/content/whole/index/content/4386/ 思路 (1)将所有边按权重从小到大排序 (2)枚举每条边a-b 权重为c if(a,b不连通) //并查集思想 将这条边 阅读全文
posted @ 2025-01-12 13:34 White_ink 阅读(12) 评论(0) 推荐(0)
摘要: 【Prim】 模版题 https://www.acwing.com/file_system/file/content/whole/index/content/4385/ 思路 (1)朴素版Prim: dist[i] <- 正无穷 for(i=0;i<n;i++){ t<-找到集合外距离最近的点 用t 阅读全文
posted @ 2025-01-12 13:01 White_ink 阅读(14) 评论(0) 推荐(0)
摘要: ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112100010833-681473226.png) 阅读全文
posted @ 2025-01-12 10:00 White_ink 阅读(12) 评论(0) 推荐(1)
摘要: ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112101639181-1641857163.png) ![image](https://img2024.cnblogs.com/blog/3544683/202501/3544683-20250112095729398-2025768444.png) 阅读全文
posted @ 2025-01-12 09:58 White_ink 阅读(8) 评论(0) 推荐(0)