摘要: 广搜省时在这道题目就明显得看出来而且不一定要走全,但是一定要走到最后那个点我的代码超时#include "iostream"#include "string.h"#include "algorithm"using namespace std;struct{ int a,b,l,t,pre;}edge[10010];int f[120],next[120],longth,MIN,k,m,n,num;void add(int a,int b,int l,int t){ edge[num].b=b; edge[num].l=l; edge[ 阅读全文
posted @ 2013-10-11 21:34 龙城星 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 看了人家的代码才知道的不知道为什么?就是每个城市最多经过4次(网上说的“闸数”)就可以跳出循环了————这个是人家说的,我也不懂仔细想了想,难道是因为超过4次的话,他就有可能超时,这样解释的话,不是大家在钻空子吗???#include "iostream"#include "string.h"using namespace std;struct{ int b,c,p,r,pre;}edge[120];int next[120],f[120],m,n,MIN,num;void add(int a,int b,int c,int p,int r){ edge 阅读全文
posted @ 2013-10-11 19:38 龙城星 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 超时了啊我的代码#include "iostream"#include "string.h"#include "algorithm"using namespace std;char dir[4]={'C','G','A','T'};int set[110],MIN,end,n;char aim[110],map[110][6];int min(int a,int b){return a>b?b:a;}void dfs(int a){ int flag=0,i,j; 阅读全文
posted @ 2013-10-11 13:32 龙城星 阅读(132) 评论(0) 推荐(0) 编辑