腌萝卜干
腌萝卜干
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
腌萝卜干的博客
全部文章
(共35篇)
题解 | #不是烤串故事#
字符串哈希快速判断两个字符串是否相等 假设最长公共前缀的函数是, 那么随着增大一定是非递减, 也就是具有二分性质 字符串哈希模板 struct Hash { vector<LL> h, p; const LL B = 131; Hash (const string...
2026-03-10
0
5
题解 | #Nowcoder Weekly Contest#
A 直接模拟即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using namespace std; using i128 = __int12...
C++
C
字符串
贪心
动态规划
哈希表
数组
2026-03-09
1
11
AtCoder Beginner Contest 448 题解
A 直接模拟即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using namespace std; using i128 = __int1...
C++
C
2026-03-08
3
21
牛客周赛126题解
A 分类讨论即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using namespace std; using i128 = __int1...
C++
C
字符串
数学
哈希表
动态规划
深度优先搜索
2026-03-07
0
13
三分求单峰函数极值题解 | #qcjj寄快递#
用和逐步逼近最小值 如果, 说明是比较大的不能选择, 因此将, 反之就是 实现代码 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using na...
2026-03-07
0
9
树型 dp + 好理解代码题解 | #Rinne Loves Edges#
子树的决策问题一般都是树形, 定义状态表示表示度数为的点无法到达的最小代价 情况, 切断当前边代价为 情况, 切断子树的某条边代价为 两种取最小值即可 #include <bits/stdc++.h> #define x first #define y second #define...
2026-03-07
1
22
题解 | #相邻的糖果#
贪心 + 双指针 注意到删除后面的糖果数量一定比删除前面的好, 因此贪心的删除后面的糖果, 并且维护当前区间是合法的 算法时间复杂度 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.b...
2026-03-06
0
17
二分 + 饱和乘法 题解 | #幂次进近#
学到个玩意叫饱和乘法 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using namespace std; using i128 = __int...
2026-03-06
0
16
好码风题解 | #[P1080] 国王游戏(简化版)#
经典贪心策略 分析交换后产生的差 发现只要按照升序的顺序排序, 得到的就是最多金币的最小值 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() usin...
2026-03-06
0
18
桶维护 | #不点两面(hard version)#
直接用两个桶维护即可, 算法时间复杂度 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() using namespace std; using i12...
2026-03-06
0
16
首页
上一页
1
2
3
4
下一页
末页