2012年8月28日
摘要: 最小生成树。CODE:#include<cstdio>#include<cstdlib>#include<cstring>#include<cmath>#include<climits> //INT_MAX,整形范围内的最大整数。#include<algorithm>usingnamespacestd;#defineINF0x3f3f3f3fconstintSIZE=110;doublew[SIZE][SIZE];doubled[SIZE];intv[SIZE];intn;structnode{doublex,y;}a[S 阅读全文
posted @ 2012-08-28 21:34 有间博客 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 最短路径题,题意简洁,思路清晰,不过WA了N次。(1)许多细节没处理好。(2)字符串的处理不到位,后来是看了别人的解题报告才用的map过的。(3)可能存在起点与终点相同的情况,而且不能直接输出0,必须用标记,因为可能数据还没处理完。CODE:#include<stdio.h>#include<map> //map容器#include<stdlib.h>#include<string.h>usingnamespacestd;#defineINF0x3f3f3f3fconstintSIZE=155;intw[SIZE][SIZE];intv[SIZE 阅读全文
posted @ 2012-08-28 16:52 有间博客 阅读(596) 评论(0) 推荐(0) 编辑