Shirlies
宁静专注认真的程序媛~
摘要: 表示对这类题目没feel,抽象。。。参考别人的代码后写出来的,顺便练习了一下FIFO队列实现Bellman-ford算法。。。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 #include <cmath> 5 using namespace std; 6 7 int g[6][105]; 8 int n,k; 9 int t[6];10 int d[105];11 int v[105];12 13 void init()14 {15 for(int i = 阅读全文
posted @ 2012-04-17 21:09 Shirlies 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 忠诚的告诉大家:uva上的题目一定要看清楚格式啊,格式错误也是WA啊,~~~~(>_<)~~~~ 因为一个换行符WA了几次。。。Dijkstra的变形。。。求一条路上的最小值然后取多条路中的最大值。。。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 int g[110][110]; 6 int v[110],d[110]; 7 int N,R; 8 int start,end,per; 9 int cas;10 11 bool init()12 { 阅读全文
posted @ 2012-04-17 19:53 Shirlies 阅读(231) 评论(0) 推荐(0) 编辑