我fo慈悲
我fo慈悲
全部文章
分类
归档
标签
去牛客网
登录
/
注册
我fo慈悲的博客
全部文章
(共55篇)
题解 | #两数之和#
#include <asm-generic/errno.h> class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { vecto...
2023-07-19
0
281
题解 | #打印从1到最大的n位数#
#include <cmath> #include <vector> class Solution { public: vector<int> printNumbers(int n) { int m=1; for(int i...
2023-07-19
0
289
题解 | #数值的整数次方#
class Solution { public: double Power(double base, int exponent) { if(exponent==0) return 1; if(exponent==1) ...
2023-07-19
0
271
题解 | #二进制中1的个数#
class Solution { public: int NumberOf1(int n) { int count_ = 0; while (n) { count_++; n = n & (n - 1...
2023-07-19
0
259
题解 | #剪绳子#
class Solution { public: int sqrt_n(int nums,int n) { if(n==0) return 1; if(n==1) return nums; ...
2023-07-19
0
236
题解 | #二分查找-I#
#include <asm-generic/errno.h> class Solution { public: int search(vector<int>& nums, int target) { if(nums.empty()) ...
2023-07-18
0
234
题解 | #旋转数组的最小数字#
class Solution { public: int minNumberInRotateArray(vector<int>& nums) { int start=0; int end=nums.size()-1; int...
2023-07-18
0
249
题解 | #斐波那契数列#
class Solution { public: Solution(int n=40) { fib[1]=fib[2]=1; for(int i=3;i<=n;++i) { fib[i]=fib[i-1]+...
2023-07-18
0
252
题解 | #斐波那契数列#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @return int整型 */ in...
2023-07-18
0
270
题解 | #链表内指定区间反转#
#include <unistd.h> class Solution { public: ListNode* reverseBetween(ListNode* head, int m, int n) { ListNode* qq = head...
2023-07-17
0
281
首页
上一页
1
2
3
4
5
6
下一页
末页