会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
劝君
渭城朝雨浥轻尘,客舍青青柳色新。劝君更尽一杯酒,西出阳关无故人。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
13
14
···
55
下一页
2024年1月3日
HDU2544 最短路 题解 Bellman-Ford算法
摘要: 题目链接:https://acm.hdu.edu.cn/showproblem.php?pid=2544 题目大意:一道简单的最短路。主要是记录一下 bellman-ford 算法的实现。 示例程序(bellman-ford): #include <bits/stdc++.h> using name
阅读全文
posted @ 2024-01-03 16:42 quanjun
阅读(29)
评论(0)
推荐(0)
2023年12月26日
洛谷B3611 【模板】传递闭包 floyd/bitset
摘要: 目录floydbitset优化 题目链接:https://www.luogu.com.cn/problem/B3611 参考题解:https://www.luogu.com.cn/blog/53022/solution-b3611 floyd #include <bits/stdc++.h> usi
阅读全文
posted @ 2023-12-26 18:02 quanjun
阅读(91)
评论(0)
推荐(0)
洛谷B3647 【模板】Floyd 题解 floyd算法 求 多源多汇最短路
摘要: floyd主要解决的问题: 多源多汇最短路:https://www.cnblogs.com/quanjun/p/17928959.html 传递闭包:https://www.cnblogs.com/quanjun/p/17928980.html 最小环:https://www.cnblogs.com
阅读全文
posted @ 2023-12-26 17:52 quanjun
阅读(349)
评论(0)
推荐(0)
P1339 [USACO09OCT] Heat Wave G 最短路入门题 Dijkstra/SPFA/Dijkstra+优先队列优化
摘要: 目录朴素的 Dijkstra 算法SPFA 算法Dijkstra + 优先队列优化 题目链接:https://www.luogu.com.cn/problem/P1339 题目大意:无向图有单源最短路。 朴素的 Dijkstra 算法 时间复杂度 \(O(n^2)\)。 #include <bits
阅读全文
posted @ 2023-12-26 17:27 quanjun
阅读(42)
评论(0)
推荐(0)
2023年12月18日
CF762E Radio stations 题解 CDQ分治
摘要: 题目链接:http://codeforces.com/problemset/problem/762/E 题目大意: 一共有 n 个电台,对于每个电台 i 有三个参数: \(x_i\), \(r_i\), \(f_i\),分别指它的一维坐标、作用半径和频率。如果两个电台的频率差值在 k 内,并且它们的
阅读全文
posted @ 2023-12-18 15:01 quanjun
阅读(21)
评论(0)
推荐(0)
2023年12月15日
洛谷P1824 进击的奶牛 题解 二分答案
摘要: 题目链接:https://www.luogu.com.cn/problem/P1824 题目大意: 本题相当于在 \(n\) 个数中选 \(c\) 个数,使得这 \(c\) 个数中相差最小的两个数之差尽可能地大。 解题思路: 我们首先可以给 \(a_1 \sim a_n\) 从小到大排一下序(这里有
阅读全文
posted @ 2023-12-15 19:11 quanjun
阅读(302)
评论(0)
推荐(0)
CF1784C Monsters (hard version) 题解 线段树
摘要: 题目链接:https://codeforces.com/problemset/problem/1784/C 题目大意: 你面前有 \(n\) 只怪兽,每只怪兽都有一个初始血量,你可以进行两类操作: 操作1:选择任意一个血量大于 \(0\) 的怪兽,并将它的血量降低 \(1\); 操作2:将所有存活的
阅读全文
posted @ 2023-12-15 18:00 quanjun
阅读(73)
评论(0)
推荐(0)
2023年10月31日
洛谷P3805 【模板】manacher
摘要: 题目链接:https://www.luogu.com.cn/problem/P3805 manacher算法模板题。 参考资料:https://oi-wiki.org/string/manacher/ 示例程序: #include <bits/stdc++.h> using namespace st
阅读全文
posted @ 2023-10-31 15:49 quanjun
阅读(44)
评论(0)
推荐(0)
2023年9月20日
Acwing393. 雇佣收银员 题解 差分约束
摘要: 题目链接:https://www.acwing.com/problem/content/description/395/ 解题思路: 差分约束。 为了方便起见,定义第 \(i\) 个时间段为 \(i-1:00\) 到 \(i:00\) 这个时间段。 首先,为了方便开一个额外的点,令 \(R_i\)
阅读全文
posted @ 2023-09-20 11:45 quanjun
阅读(17)
评论(0)
推荐(0)
2023年9月11日
排列中的数值问题(改编自NOIP2018程序填空第2大题)
摘要: 题目描述 对于一个 \(1\) 到 \(n\) 的排列 \(p_1, p_2, \ldots, p_n\)(即 \(1\) 到 \(n\) 中每一个数在数列 \(p\) 中出现了恰好一次),令 \(q_i\) 为第 \(i\) 个位置之后第一个比 \(p_i\) 值更大的位置,如果不存在这样的位置,
阅读全文
posted @ 2023-09-11 20:20 quanjun
阅读(89)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
55
下一页
公告