摘要:
1. 模板题:多余的边 思路:n条边n个点。类似于克鲁斯卡尔,加边的同时用并查集判断边的两端点是否同根,若同根,则要删除该边。 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=2000; int main() { int 阅读全文
posted @ 2026-01-23 21:17
spark_of_fire
阅读(3)
评论(0)
推荐(0)
摘要:
dijkstra(堆优化版):参加大会 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; #define inf 0x3f3f3f3f//1e9级别且2倍仍在int范围内 typedef pair<int, 阅读全文
posted @ 2026-01-23 18:37
spark_of_fire
阅读(3)
评论(0)
推荐(0)
摘要:
模板题:软件构建 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; vector<int> v[N]; int main() { int n,m; cin>>n>>m; vector<int>in(n); 阅读全文
posted @ 2026-01-23 18:01
spark_of_fire
阅读(3)
评论(0)
推荐(0)
摘要:
模板题:寻宝 1.克鲁斯卡尔(并查集) 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; typedef struct{ int w,a,b; }edge; edge e[N]; bool cmp(edge 阅读全文
posted @ 2026-01-23 17:59
spark_of_fire
阅读(2)
评论(0)
推荐(0)
浙公网安备 33010602011771号