摘要:
思路:blleman—ford检验负回路代码:#include#include#includeusing namespace std;struct infor{ int from; int to; double r; double c;};infor es[20008];double dis[200],v;int enu,n,s;bool bellman(){ memset(dis,0,sizeof(dis)); dis[s]=v; for(int i=0;i>n>>m>>s>>v; for(int i=0;i>a>>b>> 阅读全文
摘要:
思路:bellman-ford检验正回路代码:#include#include#includeusing namespace std;struct infor{ int from; int to; double r; double c;};infor es[20008];double dis[200],v;int enu,n,s;bool bellman(){ memset(dis,0,sizeof(dis)); dis[s]=v; for(int i=0;i>n>>m>>s>>v; for(int i=0;i>a>>b>> 阅读全文
摘要:
思路:Dijkstra代码:#include#include#include#includeusing namespace std;struct infor{ int x; int y;};int t,n=0;infor stone[202];double d(int x,int y){ return sqrt(x*x+y*y);}double dis[201];double map[202][202];bool visit[202];using namespace std;void dijkstra(){ while(true){ double m=10... 阅读全文