05 2020 档案

摘要:题目链接: "https://www.luogu.com.cn/problem/P1821" 题目大意:求所点 i 的从起点出发到 i 然后再从 i 返回起点的最短路径的最大值。 解题思路: 求起点到所有点的最短路可以直接得到。 求所有点到起点的最短路,可以建反图,然后用最短路算法求。 阅读全文
posted @ 2020-05-22 02:46 quanjun 阅读(138) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P1576" 解题思路完全参照自 __zjy111__ 大神的博客: "https://www.luogu.com.cn/blog/zjy111/solution p1576" 实现代码如下: 阅读全文
posted @ 2020-05-22 01:55 quanjun 阅读(84) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P6175" 题解完全参照自 __kami2004 的博客__ 大神的博客: "https://www.luogu.com.cn/blog/kami2004/solution p6175" 实现代码如下: 阅读全文
posted @ 2020-05-22 00:58 quanjun 阅读(178) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P2910" Floyd—Warshall算法的原理是动态规划。 设 dis[i][j][k] 为从 ij 只以 1k 中节点为中间结点的最短路径长度,则: (1)若最短路径经过点 $k 阅读全文
posted @ 2020-05-22 00:39 quanjun 阅读(200) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P3366" 标准Prim(O(n2+m))代码: 阅读全文
posted @ 2020-05-21 04:37 quanjun 阅读(207) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P4779" 参考博客: "https://www.cnblogs.com/ Wind /p/10164910.html" 这里用的是优先队列,时间复杂度 O(mlog m) ,实现代码如 阅读全文
posted @ 2020-05-21 01:26 quanjun 阅读(161) 评论(0) 推荐(0) 编辑
摘要:参考问题:洛谷P3379 【模板】最近公共祖先(LCA): "https://www.luogu.com.cn/problem/P3379" 暴力解法,dfs一下,求得所有点的深度,然后每当我们要求 xy 的 LCA 的时候,我们就循环的去判断: 如果当前 x 的深度大于 y 阅读全文
posted @ 2020-05-21 00:13 quanjun 阅读(201) 评论(0) 推荐(0) 编辑
摘要:示例代码: 阅读全文
posted @ 2020-05-18 01:36 quanjun 阅读(129) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P3388" 参考博客: "http://keyblog.cn/article 80.html" 实现代码如下: 阅读全文
posted @ 2020-05-18 01:35 quanjun 阅读(152) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P3376" 思路完全参照自 SYCstudio 的这篇博客: "https://www.cnblogs.com/SYCstudio/p/7260613.html" 实现代码(dinic实现): 阅读全文
posted @ 2020-05-17 22:20 quanjun 阅读(145) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P3887" 解题思路: 一开始给4组人从大到小排序然后放入4个队列,然后每次从队列中选出来人,用4个队列模拟即可。 实现代码如下: 阅读全文
posted @ 2020-05-15 15:22 quanjun 阅读(316) 评论(0) 推荐(0) 编辑
摘要:题目链接: "http://poj.org/problem?id=2585" 示例代码: 阅读全文
posted @ 2020-05-10 14:05 quanjun 阅读(63) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P1218" 实现代码如下: 阅读全文
posted @ 2020-05-07 16:33 quanjun 阅读(181) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P1161" 解题思路: 因为只有一盏灯是开着的,说明除了这盏灯被操作过奇数次以外,别的灯都被操作过偶数次(偶数包括0)。 所以我们只需要对所有的数进行异或操作,异或和就是我们的答案。 实现代码如下: 阅读全文
posted @ 2020-05-06 12:29 quanjun 阅读(360) 评论(0) 推荐(0) 编辑
摘要:题目链接: "https://www.luogu.com.cn/problem/P1330" 解题思路:DFS,判断每一个连通块是不是二分图。 实现代码如下: 阅读全文
posted @ 2020-05-01 21:34 quanjun 阅读(100) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示