摘要:
最小生成树,稀疏图用kruskal,O(ElogE)View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxr 50005#define maxn 20005struct Edge{ int u, v, w;} edge[maxr];int father[maxn];int n, m, r;int ans;bool operat 阅读全文
posted @ 2011-07-18 14:26
undefined2024
阅读(234)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 105int vis[maxn], n, m, k;int f[maxn][maxn];int main(){ //freopen("t.txt", "r", stdin); memset(f, 0, sizeof(f)); for (m = 2; m <= 100; 阅读全文
posted @ 2011-07-18 13:46
undefined2024
阅读(228)
评论(0)
推荐(0)