asto18089
asto18089
全部文章
分类
题解(10)
归档
标签
去牛客网
登录
/
注册
asto18089的博客
全部文章
(共25篇)
题解 | 动物牛的探险之旅
#include <vector> using namespace std; class Solution { public: class DSU { public: vector<int> parent, rank; ...
2025-03-13
0
45
题解 | 小红叒战小紫
import sys from functools import lru_cache MOD = 10**9 + 7 def is_terminal(R1, R2, B1, B2): a = R1 + R2 b = B1 + B2 if a == 0 or b == 0:...
2025-03-12
0
63
题解 | 最大养牛利润
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param k int整型 # @param w int整型 # @param profits int整型一维数组 # @param costs int整型一维数组 # @return int整...
2025-03-11
0
57
题解 | #三数之和#
class Solution { public: vector<vector<int> > threeSum(vector<int>& ...
C++
哈希表
双指针
2022-09-14
0
258
题解 | #链表相加(二)#
class Solution { public: ListNode* addInList(ListNode* head1, ListNode* head2) ...
C++
链表
模拟
2022-09-07
0
241
题解 | #两个链表的第一个公共结点#
class Solution { public: ListNode* FindFirstCommonNode(ListNode* pHead1, ListNode* p...
C++
链表
2022-09-07
0
301
题解 | #最长公共子串#
class Solution { public: string LCS(string str1, string str2) { &nb...
C++
动态规划
字符串
2022-09-07
0
266
题解 | #最长无重复子数组#
class Solution { public: int maxLength(vector<int>& arr) { &n...
C++
双指针
滑动窗口
2022-09-07
0
221
题解 | #设计LRU缓存结构#
class Solution { public: Solution(int capacity) : m_capacity(capacity) {} int get(int key) { ...
C++
哈希表
链表
队列
双向链表
2022-09-07
0
342
题解 | #判断是不是完全二叉树#
class Solution { public: bool isCompleteTree(TreeNode* root) { queue<TreeNode*> node_q; ...
C++
二叉树
链表
2022-09-07
0
323
首页
上一页
1
2
3
下一页
末页