觉醒火龙果很想五点下课
觉醒火龙果很想五点下课
全部文章
分类
归档
标签
去牛客网
登录
/
注册
觉醒火龙果很想五点下课的博客
全部文章
(共81篇)
题解 | 最长回文子串
class Solution { public: vector< vector<int> > dp; int getLongestPalindrome(string A) { int n = A.size(); dp.res...
2025-06-06
0
19
题解 | 完全背包
class Solution { public: vector<int> knapsack(int v, int n, vector<vector<int> >& nums) { //v背包体积, n是多少种物品, 物品体积和价值 ...
2025-06-04
0
20
题解 | 01背包
class Solution { public: int knapsack(int V, int n, vector<vector<int> >& vw) { vector<vector<int>>...
2025-05-31
0
27
题解 | 组合
class Solution { //组合,采用的是按照顺序进行选取,组合:有几个东西,多少组合在一起成一种情况,有多少种情况,选了这个或者不选这个直到选够了K个作为一种递归方式,另一种就是递归中有循环,一层递归就是选一位,循环尝试每一个数作为本位; public: vector<...
2025-05-31
0
24
题解 | 字符串的全部子序列
#include <vector> class Solution { public: set<string> ans; //采用集合的方式,自动去掉重复的元素; string temp = ""; vector<stri...
2025-05-30
0
31
题解 | 字符串的排列
#include <type_traits> class Solution { //和全排列一样的思路 public: vector<string> ans; vector<string> Permutation(string str) { ...
2025-05-29
0
35
题解 | 二叉搜索树的第k个节点
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-05-29
0
27
题解 | 二叉搜索树的第k个节点
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-05-29
0
24
题解 | 单词搜索
class Solution { public: vector<vector<int>> direction = {{0, -1},{-1, 0},{0, +1},{+1, 0} }; //左上右下 vector<vector<int>&g...
2025-05-28
0
22
题解 | 加起来和为目标值的组合(四)
class Solution { //题目限制很少,可以重复且排列不同也算,那么每一层递归时,数组全部需要检测, public: int ans = 0; int combination(vector<int>& nums, int target) { ...
2025-05-28
0
20
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页