摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1217题意就是通过货币兑换进行增值。floyd的运用,以前这题却一直不会。唉....View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cmath> 5 using namespace std; 6 char str[35][100]; 7 double map[35][35]; 8 int n,m; 9 int find(char * 阅读全文
posted @ 2012-04-12 11:44 我们一直在努力 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3790题意就不说了 相信都可以看懂,和一般的最短路唯一的不同之处就是加了一个费用限制,在最短路相同时要保证费用最小,所以要增加两个数组分别记录各边之间的费用,和到各点的最小费用,在选择点和更新时要注意 在路相同时要对费用进行判断看是否有必要更新费用。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 using nam 阅读全文
posted @ 2012-04-12 09:46 我们一直在努力 阅读(218) 评论(0) 推荐(0) 编辑