邱少卿
邱少卿
全部文章
分类
归档
标签
去牛客网
登录
/
注册
邱少卿的博客
全部文章
(共17篇)
题解 | #将真分数分解为埃及分数#
简单模拟,大力出奇迹 #include <cstdlib> #include <iostream> #include <sstream> #include <string> #include <bits/stdc++.h> using na...
2023-11-09
0
272
题解 | #风口的猪-中国牛市#
dp。 #include <vector> class Solution { public: /** * 计算你能获得的最大收益 * * @param prices Prices[i]即第i天的股价 * @return 整型 *...
2023-10-12
0
346
题解 | #不重叠的身高#
先将区间排序,随后合并 #include <climits> #include <vector> bool cmp(vector<int> a, vector<int> b){ return a[0]< b[0]; } c...
2023-10-12
0
301
题解 | #相反链表的合并#
先reverse再合并就好了 /** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution {...
2023-10-12
0
279
题解 | #动物牛的探险之旅#
核心思想就是:三类边一定比一类和二类更好。此外,如果有三类边形成的环,则打破这个环。 #include <queue> #include <unordered_map> #include <vector> class Solution { public: ...
2023-10-12
0
322
题解 | #动物牛的数学问题#
双指针,唯一注意的点是需要对idxs进行排序而不是对数组本体排序。 #include <cstddef> #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返...
2023-10-12
0
288
题解 | #牛牛的田地#
对角线遍历 #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mat int整型vecto...
2023-10-12
0
325
题解 | #牛牛的字符串解码问题#
递归 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @return string字符串 ...
2023-10-07
0
295
题解 | #牛牛的二叉树问题#
维护一个大小为m的大顶堆。 #include<bits/stdc++.h> /** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int ...
2023-10-07
0
281
题解 | #两个链表的第一个公共结点#
和官方题解稍微不同的思路。先构造一个环(将链表1连上链表2),然后再找到环的入口即可。 /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ ...
2023-10-02
0
285
首页
上一页
1
2
下一页
末页