摘要: 题目链接:http://acm.zzuli.edu.cn/showproblem?problem_id=1243本来想找能用并查集做的题目,感觉这题可以,但细细读题之后,发现我曾经看过的floyd算法一样可以,于是便牛刀小试,用floyd算法和并查集一起做了下;感觉还行;下面给出用并查集做的代码:View Code #include<stdio.h>#include<stdlib.h>#include<string.h>#define MAX 1007483647int map[110][110];int t,n,m,s;int main(){ int i, 阅读全文
posted @ 2012-03-04 20:40 world_ding 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zzuli.edu.cn/showproblem?problem_id=1245近几天开始复习算法,今天就拿出并查集复习,虽然思想是有的,但是具体细节实现的时候还是出现了失误,其实“塞翁失马,安知非福”,作为一种鞭策吧。#include<stdio.h>#include<stdlib.h>#include<string.h>int T,m,n,s,t,v;int flag[1000];struct node{ int s,t,v;}count[1000]; ////第一次开数组开的太小了,结果Runtime Error了int 阅读全文
posted @ 2012-03-04 19:35 world_ding 阅读(213) 评论(0) 推荐(0) 编辑