摘要: 转自:http://www.cnblogs.com/jackge/archive/2013/04/29/3051273.html 算法:最短路和次短路。Dijkstra算法。采用邻接表建图。 总结:不要用邻接矩阵。因为有重边。 dis[x][2]:dis[x][0]表示起点到x的最短路、... 阅读全文
posted @ 2016-11-15 22:33 see_you_later 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题意: 求 1-N 的第二长路,一条路可以重复走 if two or more shortest paths exist, the second-shortest path is the one whose length is longer than those but no longer th... 阅读全文
posted @ 2016-11-15 21:28 see_you_later 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题意:如果存在一个串是另一个串的公共前缀就是NO,否则就是YES思路:利用字典树的特性搞搞就好了#include using namespace std;const int N=1e5+10;//一共有n(10000)个串,每个串有10个数字struct Trie{ Trie* next[... 阅读全文
posted @ 2016-11-15 19:14 see_you_later 阅读(135) 评论(0) 推荐(0) 编辑