不学习就会变废物
不学习就会变废物
全部文章
分类
归档
标签
去牛客网
登录
/
注册
不学习就会变废物的博客
TA的专栏
35篇文章
0人订阅
2025考研复试
35篇文章
44人学习
全部文章
(共34篇)
题解 | 最长公共子序列(一) 栈帧最大只能放1MB数据,超过放外面当全局变量
来自专栏
int dp[1002][1002]; class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * s1和s2最长公共子序列的长度 * @param s1 stri...
2025-03-24
0
13
题解 | 还是畅通工程 kruskal算法、贪心算法、并查集
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <vector> #include <algorithm> using namespace std; // 全局数组 int father[1...
2025-03-24
0
15
题解 | 畅通工程 并查集
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> using namespace std; // 全局变量 int father[1001]; int setCount = 0; // 统计并查集(相互不连通)的数量 // 初始化...
2025-03-23
0
14
题解 | 哈夫曼树 优先队列(大根堆)
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <queue> // 小根堆 头文件 using namespace std; int main(){ // 默认大根堆 priority_queu...
2025-03-22
0
17
题解 | 二叉搜索树 中序+先序/后序 唯一 确定一棵树
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string> using namespace std; // 无需parent找父节点 struct TreeNode { char data; ...
2025-03-21
0
14
题解 | 二叉树 nan
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> using namespace std; int main() { int n, m; scanf("%d%d", &m, &n); /...
2025-03-21
0
14
题解 | 二叉树遍历 分治法创建树+递归中序遍历
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> using namespace std; struct TreeNode { char data; TreeNode* left; TreeNode* right; }; //...
2025-03-21
0
19
题解 | 2的幂次方 分治递归
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string> #include <vector> using namespace std; // 求n的指数形式 string Get2s...
2025-03-19
0
23
题解 | 计算表达式 栈+ma设置优先级
来自专栏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string> #include <stack> #include <map> using namespace std; int...
2025-03-18
0
22
题解 | 编排字符串 c++输出
来自专栏
#include <iostream> #include <stack> // 后进先出 using namespace std; int main() { stack<string> strStack; stack<string> outSt...
2025-03-18
0
20
首页
上一页
1
2
3
4
下一页
末页