摘要: 题目链接:Link Problem Solution 不难发现:Floyd的计算过程非常类似于矩阵乘法,尝试对其进行分治后不难证明可以套用矩阵快速幂的方法进行快速计算。 Code #include<cstdio> #include<cstring> #include<algorithm> #incl 阅读全文
posted @ 2019-10-11 20:29 happyZYM 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目链接:Link Problem Solution 这题几乎是一个裸的无向图最小环,用一个数组记录最短路的中间节点是什么即可。 Code #include<cstdio> #include<cstring> #include<algorithm> #include<vector> using na 阅读全文
posted @ 2019-10-11 20:03 happyZYM 阅读(159) 评论(0) 推荐(0) 编辑