找工作的葡萄
找工作的葡萄
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
找工作的葡萄的博客
全部文章
(共4篇)
题解 | #火星探测器稳定性分析#
两种解法:1、按条件暴力搜索+剪枝 2、滑动窗口+双端队列维护最值的索引 1、两层循环,嘎嘎暴力,剪枝思路: (1)nums[i]范围不满足,直接开启下一轮循环; (2)从索引i开始的剩余元素数量,比当前最长稳定序列小,和整个循环说“告辞”; (3) 如果稳定字符串因为下一个值范围越界而结束,[i ...
C++
滑动窗口
2025-09-01
0
25
题解 | 数组同构
#include <iostream> #include <queue> using namespace std; int GFunction(long x) { // 默认 x >= 1 int res = 0; while (x) { ...
2025-08-29
0
34
题解 | 小明打砖块
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, a, b, c; cin >> n...
2025-08-19
0
44
题解 | 放它一马
#include <algorithm> #include <climits> #include <iostream> #include <vector> using namespace std; int main() { int n; ...
2025-08-17
0
61