摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1233题意:连接所有村子的最短路径。分析:最小生成树。注意:双向图。嗨,表示水题不认真又wa了 3次。View Code // I'm lanjiangzhou//C#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <math.h>#include <time.h>//C++#include <iostream 阅读全文
posted @ 2013-04-07 23:28
南下的小程序员
阅读(238)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1875题意:求链接所有岛屿的最小生成树。中文题就不说了。分析:kruskal算法。用sqrt的时候ce了一次。然后数组开小了re了一次。不应该犯这种低级错误了。反思己过。View Code // I'm lanjiangzhou//C#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <math.h>#include <ti 阅读全文
posted @ 2013-04-07 22:06
南下的小程序员
阅读(151)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3666题目描述:http://blog.sina.com.cn/s/blog_64675f540100l52h.html给你一个N*M的矩阵,给你两个数L和U(L <= U)问你是否存在这样的N+M个数字(计作A1….AN, B1…..BM),使矩阵中任意元素Xij,满足:L <= (Xij * Ai) / Bj <= U输出YES OR NO。解题报告:转换成:Xij * Ai – U * Bj <= 0 和 L*Bj – Xij * Ai <= 0差分约束中的xi – xj 阅读全文
posted @ 2013-04-07 21:17
南下的小程序员
阅读(154)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3592题意:有N个人按照1-N 的顺序排成一排,给你X个关于他们位置的关系,如:a, b ,c,则说明编号为a的人在标号为b 的人的前面(话说我实在没在原文中看到a必须在b前面,除非这句Assume that there are N (2 <= N <= 1,000) people numbered 1..N who are standing in the same order as they are numbered. It is possible that two or more person 阅读全文
posted @ 2013-04-07 19:55
南下的小程序员
阅读(179)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2680题意:求起点到终点的最短距离,注意这题是有向图,还有这题先给的是终点,起点有多个(如果是无向图的话先给起点终点是一样的,先给终点细细体会稍微有点区别)。分析:先给终点,起点有多个。我一开始知道是有向图但就是按照无向图做的,好吧,wa了。然后该了该,还是wa。认真读题觉得没问题又提交了还是wa。然后觉得这题很有意思,应该注意什么东西。想到了以前都是先知道起点,然后求dis[end],发现建图的时候要反过来,edge[v][u]=w.一开始就看到有重边,早早就出来了重边,但是数据还是没过,郁闷了,不知道怎么 阅读全文
posted @ 2013-04-07 00:40
南下的小程序员
阅读(535)
评论(0)
推荐(0)

浙公网安备 33010602011771号