随笔分类 - vjudge
P3959 [NOIP2017 提高组] 宝藏 --状态压缩dp,dfs
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; constexpr int N = 15; int n, m, lim, ans = 2e9, G[N
阅读全文
P2024食物链 - 种类并查集datastructure
摘要:#include <bits/stdc++.h> #define dbg(x) std::cerr << #x << "=" << x << "\n" using i64 = long long; constexpr int N = 100005; int fa[N * 3]; int find(i
阅读全文
City - 并查集路径压缩与按秩合并 datastructure
摘要:#include <bits/stdc++.h> using i64 = long long; #define dbg(x) std::cerr << #x << "=" << x << "\n" struct node{ int u,v,w; }; int fa[100005], rank[100
阅读全文