10 2019 档案

摘要:#include<bits/stdc++.h> using namespace std; const int maxn = 500005; struct edge{ int next, to; }e[maxn << 1]; int head[maxn], cnt; int n, m, s, a, b, xx, yy; int depth[maxn], fa[maxn][22]; void add( 阅读全文
posted @ 2019-10-31 20:03 ATKevin 阅读(116) 评论(0) 推荐(0)
摘要:先注意初始化dp[], 后注意预处理dp[1]等 例如 acwing 1018最低通行费中没有初始化dp[][],和预处理dp[1][0],dp[0][1] 阅读全文
posted @ 2019-10-20 10:37 ATKevin 阅读(77) 评论(0) 推荐(0)
摘要:https://www.acwing.com/blog/content/32/ 1.n≤30, 指数级别, dfs+剪枝,状态压缩dp2.n≤100=> O(n^3), floyd(图论),dp3.n≤1000=> O(n^2),O(n ^2 logn), dp,二分4.n≤10000=> O(n 阅读全文
posted @ 2019-10-13 13:45 ATKevin 阅读(716) 评论(0) 推荐(0)
摘要:prim:给出一个无向图,求出最小生成树,如果该图不连通,则输出impossible。 #include<bits/stdc++.h>using namespace std;const int maxm = 200005;const int inf = 0x3f3f3f3f;struct edge{ 阅读全文
posted @ 2019-10-01 13:27 ATKevin 阅读(186) 评论(0) 推荐(0)