腌萝卜干
腌萝卜干
全部文章
分类
未归档(199)
题解(7)
归档
标签
去牛客网
登录
/
注册
腌萝卜干的博客
全部文章
(共264篇)
题解 | #dd爱框框#
滑窗板子 #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-04-21
0
8
题解 | #最大稳定数值#
贴个代码吧 #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-04-19
0
6
题解 | #数独数组#
对于任何合法的数独数组,每个数字出现的次数只有两种可能 也就是就是非法状态 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define v...
2026-04-15
0
20
题解 | #小美的01串翻转#
注意到, 最终的状态一定是下面的两种 因此预处理出每个字符变成对应字符的代价, 取最小值累计答案即可, 算法时间复杂度 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begi...
2026-04-14
1
18
题解 | #小红的部分不同字符串#
假设每个条件都是向连接一条边, 那么最终构成的是基环树森林 对于一个元环, 假设有个颜色, 求染色方案数, 首先将环展开为链, 那么方案数为 最后一个位置还需要和第一个位置链接起来 假设元环的染色方案记为 假设位置颜色和位置不同, 那么位置的颜色, 那么就是前个位置染色, 方案数是 假设位置...
C++
动态规划
数学
2026-04-13
2
38
AtCoder Beginner Contest 453 (A ~ E)题解
A 语法 字符串只能操作back, 可以将字符串操作后恢复 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #define vec1(T, name...
C++
C
哈希表
数学
深度优先搜索
字符串
动态规划
广度优先搜索
2026-04-12
0
39
题解 | #圆覆盖#
按照对所有的点进行排序 然后求出点权的前缀和 很容易想到双二分, 注意一下数据的边界, 如果无解 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #d...
2026-04-11
0
28
题解 | #小红的图上加边#
简单贪心策略 为了使更大的权值被加的次数尽可能的少, 每个连通块按照最大值从小到大排序, 除了第一个剩余累加起来就是最小代价 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin...
2026-04-10
1
36
题解 | #绿豆蛙的归宿#
首先拓扑排序 然后定义状态表示表示从当前点到达的期望, 根据无后效性原理, 从后向前即可 #include <bits/stdc++.h> #define x first #define y second #define all(x) x.begin(), x.end() #defin...
2026-04-09
1
28
题解 | #抽卡#
数学题 #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> n...
2026-04-08
0
27
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页