用心的布莱克刷牛客
用心的布莱克刷牛客
全部文章
分类
归档
标签
去牛客网
登录
/
注册
用心的布莱克刷牛客的博客
全部文章
(共32篇)
单调队列,一次遍历实现
#include <iostream> using namespace std; #include <vector> #include <deque> #include <sstream> int main() { //单调双端队列,维护一个单...
2026-01-16
0
17
C++一次遍历实现
#include <iostream> using namespace std; #include <vector> #include <algorithm> int main() { //用数组存储包裹编号,再创建一个按编号从小到大排序好的...
2026-01-16
0
18
转为后缀表达式计算
#include <iostream> #include <string> #include <stack> using namespace std; using ll = long long; // 定义运算符优先级 int priority(char op)...
2026-01-14
0
22
排序后遍历加剪枝
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <climits> #include <set> #inc...
2026-01-14
1
19
动态规划
#include <iostream> #include <vector> using namespace std; int main() { vector<int> a;//存储每个星尘的能量 int num; while(cin &g...
2026-01-14
0
17
题解 | 字符串排序
#include <iostream> #include<algorithm> using namespace std; //字符串s中有空格,我们使用getline来读取 //先遍历字符串将其中的字母字符存下来,对其进行排序(不区分大小写需要自定义规则) //遍历原字符串,...
2025-06-09
0
75
题解 | 数据分类处理
#include <iostream> #include<string> #include<set> #include<vector> using namespace std; //用一个set<string>来存储规则集r(自动排序去重)...
2025-05-22
0
67
题解 | 最长递增子序列
#include <algorithm> class AscentSequence { public: int findLongest(vector<int> A, int n) { // write code here //原版LIS...
2025-05-21
0
106
题解 | 合唱队
#include <iostream> #include<vector> using namespace std; //遍历每一位同学作为中心位置,对中心的左边部分求LIS,对右边部分求最长递减子序列,将两部分长度相加求和,最后我们取所有和中的最大值即可 //LIS问题:1,...
2025-05-21
0
84
题解 | 在字符串中找出连续最长的数字串
#include <iostream> #include<vector> using namespace std; //按照正常逻辑来做就可以,用一个二维数组容器存储所有的数字子串 //依次处理每个字符,如果是数字则push到容器中,然后cnt+1 //如果重新遇到字母,则上...
2025-05-21
0
107
首页
上一页
1
2
3
4
下一页
末页