上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 60 下一页
摘要: 题目链接: "https://www.luogu.com.cn/problem/P3366" 标准Prim($O(n^2+m)$)代码: 阅读全文
posted @ 2020-05-21 04:37 quanjun 阅读(254) 评论(0) 推荐(0)
摘要: 题目链接: "https://www.luogu.com.cn/problem/P4779" 参考博客: "https://www.cnblogs.com/ Wind /p/10164910.html" 这里用的是优先队列,时间复杂度 $O(m \cdot \text{log }m)$ ,实现代码如 阅读全文
posted @ 2020-05-21 01:26 quanjun 阅读(188) 评论(0) 推荐(0)
摘要: 参考问题:洛谷P3379 【模板】最近公共祖先(LCA): "https://www.luogu.com.cn/problem/P3379" 暴力解法,dfs一下,求得所有点的深度,然后每当我们要求 $x$ 和 $y$ 的 LCA 的时候,我们就循环的去判断: 如果当前 $x$ 的深度大于 $y$ 阅读全文
posted @ 2020-05-21 00:13 quanjun 阅读(246) 评论(0) 推荐(0)
摘要: 示例代码: 阅读全文
posted @ 2020-05-18 01:36 quanjun 阅读(137) 评论(0) 推荐(0)
摘要: 题目链接: "https://www.luogu.com.cn/problem/P3388" 参考博客: "http://keyblog.cn/article 80.html" 实现代码如下: 阅读全文
posted @ 2020-05-18 01:35 quanjun 阅读(168) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3376 思路完全参照自 SYCstudio 的这篇博客:https://www.cnblogs.com/SYCstudio/p/7260613.html 实现代码(dinic实现;2025/12/1 更新) #inclu 阅读全文
posted @ 2020-05-17 22:20 quanjun 阅读(173) 评论(0) 推荐(0)
摘要: 题目链接: "https://www.luogu.com.cn/problem/P3887" 解题思路: 一开始给4组人从大到小排序然后放入4个队列,然后每次从队列中选出来人,用4个队列模拟即可。 实现代码如下: 阅读全文
posted @ 2020-05-15 15:22 quanjun 阅读(412) 评论(0) 推荐(0)
摘要: 题目链接: "http://poj.org/problem?id=2585" 示例代码: 阅读全文
posted @ 2020-05-10 14:05 quanjun 阅读(74) 评论(0) 推荐(0)
摘要: 题目链接: "https://www.luogu.com.cn/problem/P1218" 实现代码如下: 阅读全文
posted @ 2020-05-07 16:33 quanjun 阅读(204) 评论(0) 推荐(0)
摘要: 题目链接: "https://www.luogu.com.cn/problem/P1161" 解题思路: 因为只有一盏灯是开着的,说明除了这盏灯被操作过奇数次以外,别的灯都被操作过偶数次(偶数包括0)。 所以我们只需要对所有的数进行异或操作,异或和就是我们的答案。 实现代码如下: 阅读全文
posted @ 2020-05-06 12:29 quanjun 阅读(419) 评论(0) 推荐(0)
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 60 下一页