腌萝卜干
腌萝卜干
全部文章
分类
未归档(199)
题解(4)
归档
标签
去牛客网
登录
/
注册
腌萝卜干的博客
全部文章
(共250篇)
题解 | #【模板】二维差分#
终于一遍过了 #include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int> PII;...
2026-01-28
0
33
异或前缀和 题解 | #被打乱的异或和#
贴一个利用异或性质的代码 #include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int>...
2026-01-28
0
30
打表观察数学性质 | #小苯的最短路#
数据范围可以视为, 因此任何计算的算法都无法解决, 先打表找找规律 打表代码 #include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; t...
2026-01-28
0
45
题解 | #排座椅#
分析 不难发现, 因为交头接耳的同学都是相邻的, 因此或者是相等的 另一个维度的最小值就是需要放置道路覆盖的位置 又因为每一对的交头接耳的同学只会影响一行或者一列 因此可以行列分开计算, 计算交头接耳同学前多的行和前多的列, 贪心即可 代码实现 #include <bits/stdc++.h&...
2026-01-27
0
41
题解 | #小红闯关#
分析 正向贪心难以计算, 倒序思考 对于当前位置, 假设获得了跳关的机会, 那么将在区间内能使用 很显然, 需要找到的最大花费的跳过, 可以使用最大堆实现 代码实现 #include <bits/stdc++.h> #define x first #define y second u...
2026-01-27
0
36
题解 | #游游的二进制树#
分析 注意到数据范围不大 点的数量是, 边的数量也是 可以用解决 每个点作为根查找一下路径 发现满足条件累计答案 算法时间复杂度可以通过 代码实现 #include <bits/stdc++.h> #define x first #define y second using na...
2026-01-27
0
27
题解 | #交换到最大#
分析 非常好题目, 使我的大脑旋转 错误思路: 对于每个位置, 如果发现, 交换 这个是错误的, 因为交换后当前位置还是可以继续向前交换的 正确做法 对于每个位置, 因为只能与右侧的数字进行交换, 假设位置是, 那么交换的条件就是 也就是说需要找到一个最大的 因为每个位置的字符都是数字, 因此范围是...
2026-01-27
0
43
离线树状数组 + 离散化 | 音符
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int> PII; const...
2026-01-26
0
39
题解 | 邮递员送信
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int> PII; const...
2026-01-25
0
36
题解 | 【模板】排序
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int> PII; const...
2026-01-24
1
37
首页
上一页
16
17
18
19
20
21
22
23
24
25
下一页
末页