题目链接:点我点我 题意:给出一个最短路的图,询问是否正确,如果正确的话,输出遍历所有点的最短路径和。 题解:判断是否正确的,直接再一次Floyd,判断是否会有A[i][k]+A[k][j]<A[i][j](通过中间点k使得两点间距离更短),如果有的话,直接输出-1。 要遍历到所有道路,并且路径和最 ...
分类:
Web程序 时间:
2017-09-20 01:01:19
阅读次数:
315
D - Restoring Road Network Time limit : 2sec / Memory limit : 256MB Score : 500 points Problem Statement In Takahashi Kingdom, which once existed, the ...
分类:
Web程序 时间:
2017-09-17 22:22:16
阅读次数:
243
【算法】图论,最短路? 【题意】原图为无向连通图,现给定原图的最短路矩阵,求原图最小边权和,n<=300。 【题解】要求最小边权和下,原图的所有边一定是所连两端点的最短路。 那么现在将所有最短路作为边加入原图,考虑删边。 对于(u,v),若存在点w使得(u,v)=(u,w)+(w,v),则(u,v) ...
分类:
Web程序 时间:
2017-09-17 15:08:42
阅读次数:
307
个人心得:看懂题目花费了不少时间,后面实现确实时间有点仓促了,只是简单的做出了判断是否为真假的情况, 后面看了题解发现其实在判断时候其实能够一起解决的,算了,基础比较差还是慢慢的来吧。 题意概述: 就是给定一个N阶方阵,规定Auv,为u到v的最短路径,若给出的数据存在其他通路少于此时的值则不存在即为 ...
分类:
编程语言 时间:
2017-09-17 13:28:07
阅读次数:
270
In Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads. The following are known ...
分类:
Web程序 时间:
2017-09-16 23:24:24
阅读次数:
325
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up ...
分类:
其他好文 时间:
2017-09-12 09:55:12
阅读次数:
185
A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a si ...
分类:
其他好文 时间:
2017-09-09 22:39:31
阅读次数:
242
1 #include 2 #include 3 #include 4 #define MAXN 210 5 #define INF 2147483646 6 using namespace std; 7 8 int f[MAXN], Rank[MAXN]; //Rank长度 9 int n, m, ... ...
分类:
其他好文 时间:
2017-09-01 22:19:00
阅读次数:
160
The Karting championship will be held on a straight road. There are N keypoints on the road. The path between keypoint i and i+1 has a degree of diffi ...
分类:
其他好文 时间:
2017-08-30 18:33:34
阅读次数:
183
From: http://www.openglsuperbible.com/2013/10/16/the-road-to-one-million-draws/ This is a capture of the multidrawindirect sample from our example cod ...
分类:
其他好文 时间:
2017-08-29 14:20:03
阅读次数:
132