城城城<
城城城<
全部文章
分类
归档
标签
去牛客网
登录
/
注册
城城城<的博客
全部文章
(共74篇)
题解 | #二进制中1的个数#
class Solution { public: int NumberOf1(int n) { bool b=false; if(n<0) { n=-n-1; b=true; ...
2023-05-06
0
204
题解 | #剪绳子#
class Solution { public: int cutRope(int number) { if(number<=4) { return number; } vector<int&g...
2023-05-06
0
150
题解 | #顺时针打印矩阵#
class Printer { public: vector<int> clockwisePrint(vector<vector<int> > mat, int n, int m) { vector<int> ans; ...
2023-05-06
0
211
题解 | #合唱团#
//逻辑感觉还是有漏洞,但是样例过了 #include<iostream> #include<vector> using namespace std; int s = 0; void dp(const vector<long long>& a,vector<...
2023-05-06
0
339
题解 | #简单错误记录#
//使用两个map,map<string,int>储存次数,map<int,string>储存顺序 #include<iostream> #include<map> #include<string> using namespace std;...
2023-04-27
0
236
题解 | #旋转数组的最小数字#
class Solution { public: int minNumberInRotateArray(vector<int> rotateArray) { int l=0; int r=rotateArray.size()-1; ...
2023-04-27
0
183
题解 | #斐波那契数列#
class Solution { public: int Fibonacci(int n) { int a=1,b=0,c=0; for(int i=0;i<n;i++) { c=a+b; ...
2023-04-26
0
168
题解 | #用两个栈实现队列#
class Solution { public: void push(int node) { while(!stack2.empty()) { stack1.push(stack2.top()); stack2....
2023-04-26
0
195
题解 | #二叉树的下一个结点#
/* struct TreeLinkNode { int val; struct TreeLinkNode *left; struct TreeLinkNode *right; struct TreeLinkNode *next; TreeLinkNode(i...
2023-04-26
0
195
题解 | #重建二叉树#
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x),...
2023-04-26
0
225
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页