LeeBlog

导航

随笔分类 -  最短路

HDU 1596 find the safest road
摘要:这题就是一最短路,不过,在这里是找"最长路",所以在初始化时不能赋值为0x7fffffff,而赋为0,还有存贮是记得用double型#include<stdio.h>int n,q,des[1005],s,e;double map[1005][1005],dis[1005];double Dij( ){ for( int i = 0; i <= n; ++i ) des[i] = 0,dis[i] = 0; dis[s] = 1; for( int i = 1; i <= n; ++i ) { int pos = -1; double max = - 阅读全文

posted @ 2011-05-03 07:52 LeeBlog 阅读(230) 评论(0) 推荐(0)