腌萝卜干
腌萝卜干
全部文章
分类
未归档(199)
题解(8)
归档
标签
去牛客网
登录
/
注册
腌萝卜干的博客
全部文章
(共282篇)
题解 | #小红的素数合并#
简单题 不难发现素数乘素数不是素数, 也就是每个数只会最多和一个数字配对, 对于奇数的情况直接把最大的那个数使其不参与配对即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begi...
2026-05-31
0
7
ABC460(A~F)题解
A 模拟一下即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name, n, val) vector<T...
C++
2026-05-31
0
13
题解 | #dd爱科学2.0#
假设从前向后填写字符, 那么前面的一定, 因此可以记录一个前缀最小值 定义状态表示处理好了前个字符, 并且将第个字符变化为的最小代价 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.b...
2026-05-30
0
9
题解 | #桃花#
求树的直径 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name, n, val) vector<T>...
2026-05-26
1
20
题解 | #dd爱科学1.0#
反链定理 求最长非下降子序列长度等价于求最少需要多少个最长严格下降子序列将原序列覆盖 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define ...
2026-05-26
0
11
题解 | #牛牛走迷宫#
逆序处理, 从前向后贪心, 每次选择字典序最小的字符加入到操作集合 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, n...
2026-05-23
0
26
题解 | #拼三角#
直接枚举即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name, n, val) vector<T>...
2026-05-22
0
18
题解 | #逃跑路线#
算一下最终位置坐标的奇偶性就行 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name, n, val) vecto...
2026-05-17
0
30
欢迎复制模板喵 | #【模板】最近公共祖先(LCA)#
#include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name, n, val) vector<T> name(...
2026-05-13
0
21
题解 | #换个角度思考#
我最开始做的是线段树每个节点维护一个桶, 空间算错了, 直接爆了, 正确做法是主席树或者离线树状数组 将查询分为和, 分别查询累加贡献 #include <bits/stdc++.h> #define x first #define y second #define all(x) x....
2026-05-12
0
27
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页