摘要:
题目链接。#include <stdio.h>#include <stdlib.h>#define MAXN 5000int v[MAXN], u[MAXN], p[101], w[MAXN], r[MAXN];int find(int x){return p[x] == x ? x : (p[x] = find(p[x]));}int comp(const void *a, const void *b){ int x = *(int *)a, y = *(int *)b; return w[x] - w[y];}int main(){ int n, m, i, s, 阅读全文
posted @ 2013-01-28 20:58
Still_Raining
阅读(221)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1232#include <stdio.h>#include <stdlib.h>#define MAXN 2000int v[MAXN], u[MAXN], p[MAXN];int icount;int find_f(int x){return p[x] == x ? x : (p[x]=find_f(p[x]));}int main(){ int n, m, i; while(scanf("%d", &n) == 1 && n != 0){ 阅读全文
posted @ 2013-01-28 20:09
Still_Raining
阅读(221)
评论(0)
推荐(0)
浙公网安备 33010602011771号