a天河朔夜a
a天河朔夜a
全部文章
分类
归档
标签
去牛客网
登录
/
注册
a天河朔夜a的博客
全部文章
(共72篇)
题解 | #数组中出现次数超过一半的数字#
class Solution { public: int MoreThanHalfNum_Solution(vector<int> numbers) { unordered_map<int,int>hash; for(auto x:nu...
2023-03-17
0
312
题解 | #两数之和#
class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { unordered_map<int,int>p; for(int...
2023-03-16
0
254
题解 | #表达式求值#
class Solution { public: int solve(string s) { stack<int>s1; stack<char>s2; s2.push('#'); bool ...
2023-03-16
0
337
题解 | #数据流中的中位数#
class Solution { public: void Insert(int num) { p.push_back(num); int i=p.size()-1; while(i>=1&&p[i]<p[i-1])swap(p...
2023-03-16
0
311
题解 | #寻找第K大#
class Solution { public: int go(int fi, int end, vector<int>& p, int k) { if (fi == end)return fi; int zd = p[rand()%(end-...
2023-03-16
0
259
题解 | #最小的K个数#
class Solution { public: vector<int> so(int l, int r, vector<int>& input) { if (l > r) { vector<int>k; ...
2023-03-15
0
238
题解 | #最小的K个数#
class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { sort(input.begin(),input.end()); ...
2023-03-15
0
223
题解 | #滑动窗口的最大值#
class Solution { public: vector<int> maxInWindows(const vector<int>& num, unsigned int size) { int que[10010], h = 0, t = -1...
2023-03-15
0
250
题解 | #有效括号序列#
class Solution { public: bool isValid(string s) { stack<char>st; for (auto x : s) { if (st.empty()) { ...
2023-03-15
0
266
题解 | #包含min函数的栈#
class Solution { public: void push(int value) { m=::min(m,value); auto*k=new TreeNode(value); k->right=st; st=k...
2023-03-15
0
185
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页