摘要:
使用优先队列+邻接表的prime算法果然比以前的O(n^3)要快很多哈 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include using namespace std; typedef struct { ... 阅读全文
摘要:
最近研究了这东西 感觉十分有用 在对于少边的情况下效果十分明显 本程序使用优先队列存储边信息 使用并查集判定是否已经连通 O(eloge)的复杂度 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include us... 阅读全文
摘要:
这是一道省赛题目 解法是构造概率矩阵A 根据要进行的次数n 使用二分法计算转移矩阵(A)^n 再使用转移公式res=init*(A)^n 可以很快计算出最终答案 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1#include ... 阅读全文
摘要:
简单的单源最短路径 使用二叉堆+邻接表+DIJ实现~~~ Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1#include 2#include 3#include 4#include 5using namespace st... 阅读全文
摘要:
从月光大牛那抢来的代码 研究了一晚上 把注释都补上了 邻接表真是强大哈 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1#include//读入,并输出 2using namespace std; 3 4const long LMAX... 阅读全文