摘要:        
众所周知,bellman_ford算法最常用的性质是判负环 也可以求最短路,SPFA算法改自Bellman_Ford。 1074 Extended Traffic $(u,v)$的边权是$ (b[v] b[u])^3$,输出从顶点1到各点最短路径,因为存在负环,所以从负环到达的点的最短路是 inf。    阅读全文
posted @ 2017-08-20 00:49
可达龙
阅读(291)
评论(0)
推荐(0)
        
            
        
        
摘要:        
"题目链接" 暴力枚举结果情况,然后跟当前比较,找到最小次数 C++ include include include using namespace std; int t; char s[1005]; int main() { scanf("%d", &t); while(t ) { scanf("    阅读全文
posted @ 2017-08-20 00:11
可达龙
阅读(261)
评论(0)
推荐(0)
        
                    
                
浙公网安备 33010602011771号