1 2 3 4 5 ··· 64 下一页
摘要: 题目链接:https://www.luogu.com.cn/problem/P2742 解题思路: 解决本题的核心在于使用计算几何算法求出点集的最小凸多边形(凸包),并计算其周长。 推荐使用现代算法竞赛中最常用的 Andrew 算法(Graham 扫描法的变体),该算法逻辑清晰、不易写错、不需要处理 阅读全文
posted @ 2026-07-30 20:21 quanjun 阅读(2) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4559 解题思路:完全来自 小粉兔 大佬的博客 示例程序: #include <bits/stdc++.h> using namespace std; using ll = long long; const int ma 阅读全文
posted @ 2026-07-19 13:32 quanjun 阅读(4) 评论(0) 推荐(0)
摘要: 以下是我按照下方代码重新写了一遍之后的代码: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; const double alpha = 0.7; // 平衡因子 int root, idx, val[ma 阅读全文
posted @ 2026-07-05 20:19 quanjun 阅读(9) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3690 解题思路来自 《算法竞赛》这本书 (注:书中代码有些许bug,这里没有~) 代码参考自 算法竞赛书本中的代码,即 ecnerwaIa大佬的博客 示例程序: #include <bits/stdc++.h> usi 阅读全文
posted @ 2026-06-05 11:35 quanjun 阅读(11) 评论(0) 推荐(0)
摘要: 1. 我常常追忆过去。 出现在 P11831 [省选联考 2025] 追忆 的题目背景中。 阅读全文
posted @ 2026-05-28 20:37 quanjun 阅读(26) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P2865 题目大意:求严格次短路。 解题思路: 先 spfa 跑一遍反图(由于是无向图,所以反图和原图其实是一样的图),得到估计函数的确定精确值。 然后 A* 跑一遍,即可。 示例程序: #include <bits/st 阅读全文
posted @ 2026-05-27 14:23 quanjun 阅读(20) 评论(0) 推荐(0)
摘要: 题目链接:https://codeforces.com/problemset/problem/896/C 解题思路:完全来自 oi.wiki 示例程序: #include <bits/stdc++.h> using namespace std; using ll = long long; const 阅读全文
posted @ 2026-05-25 14:06 quanjun 阅读(27) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4777 解题思路:完全来自 oi.wiki 注意:中间过程有一步可能会超 long long,得开 int128(代码第 \(39\) 行,因为这里有三个数相乘了) 示例程序: #include <bits/stdc++ 阅读全文
posted @ 2026-05-25 11:00 quanjun 阅读(7) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3193 解题思路: 建立完 KMP 的 nxt 数组之后(其实也可以建状态机,但是 \(m \le 20\) 所以建 状态机 并不是必要的),构造一个转移矩阵。然后矩阵乘法优化,就能够得到答案了。 #include <b 阅读全文
posted @ 2026-05-21 20:53 quanjun 阅读(11) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4345 解题思路: 示例程序: #include <bits/stdc++.h> using namespace std; using ll = long long; const ll p = 2333; ll c[p+ 阅读全文
posted @ 2026-05-21 16:53 quanjun 阅读(9) 评论(0) 推荐(0)
1 2 3 4 5 ··· 64 下一页