摘要: 题目链接SPFA果真是功能强大,1Y。 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <queue> 5 #include <iostream> 6 using namespace std; 7 #define N 10000000 8 double p1[101][101],p2[101][101],d[101],v; 9 int n;10 int spfa(int str)11 {12 int in[101],u,i;13 memset 阅读全文
posted @ 2012-11-27 19:23 Naix_x 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目链接搞笑的题目。。。DFS过的。。。 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 using namespace std; 6 #define N 10000000 7 int map[101][101],o[101],n,m,val[101],z[101]; 8 int dfs(int x,int a,int b) 9 {10 int i,ans = val[x],t;11 if(b - a > n) retur 阅读全文
posted @ 2012-11-27 17:14 Naix_x 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目链接这个题就是找到1 到 2之间的路径上所有经过路的最大值中的最小值。。。有点绕,反正就是最短路的变形。。。没太想清楚怎么写,写了spfa和floyd都错了,没想清楚怎么变形啊。。。一个地方想错了。。。改了都过了。。 1 #include <cstdio>//spfa算法 2 #include <cstring> 3 #include <cmath> 4 #include <queue> 5 using namespace std; 6 #define INF 0x3f3f3f3f 7 #define eps 1e-7 8 double dp 阅读全文
posted @ 2012-11-27 15:05 Naix_x 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 做的我好郁闷啊。。。卡到死了,想了一个暴力方法,枚举骑士和国王相遇的点,再枚举所有的骑士相遇的点。这样复杂度基本上上亿了,然后卡了几天,看了看题解,枚举国王和骑士的相遇的时候只需要枚举国王周围的几个点就行了。。。然后原来写的代码,各种BUG啊。。。各种调试,各种提交,各种错误n,m看错各种变量写错,实在是无语,最后终于检查不出错误了,提交还是挂了。。。找AC代码 换函数。。。最后还是没检查出那里错了,换了跟AC代码的写法,终于过了。。。这题真心不想做第二遍了。。。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: camelot 5 ... 阅读全文
posted @ 2012-11-27 13:41 Naix_x 阅读(176) 评论(0) 推荐(0) 编辑