会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
···
38
下一页
2020年4月30日
857. 雇佣 K 名工人的最低成本
摘要: 1 class Solution 2 { 3 public: 4 double mincostToHireWorkers(vector<int>& quality, vector<int>& wage, int K) 5 { 6 vector<pair<double,int>> vec; 7 for
阅读全文
posted @ 2020-04-30 10:36 Jinxiaobo0509
阅读(225)
评论(0)
推荐(0)
2020年4月29日
224. 基本计算器
摘要: 1 class Solution 2 { 3 void calc(stack<char>& op,stack<int>& num) 4 { 5 int y = num.top(); 6 num.pop(); 7 int x = num.top(); 8 num.pop(); 9 if(op.top(
阅读全文
posted @ 2020-04-29 22:41 Jinxiaobo0509
阅读(206)
评论(0)
推荐(0)
57. 插入区间
摘要: 1 class Solution 2 { 3 public: 4 vector<vector<int>> insert(vector<vector<int>>& nums, vector<int>& newInterval) 5 { 6 nums.push_back(newInterval); 7
阅读全文
posted @ 2020-04-29 21:55 Jinxiaobo0509
阅读(148)
评论(0)
推荐(0)
930. 和相同的二元子数组
摘要: 1 class Solution 2 { 3 public: 4 int numSubarraysWithSum(vector<int>& nums, int k) 5 { 6 unordered_map<int,int> hash;// 和+次数 7 hash[0] = 1; 8 9 int re
阅读全文
posted @ 2020-04-29 21:13 Jinxiaobo0509
阅读(158)
评论(0)
推荐(0)
883. 三维形体投影面积
摘要: 1 class Solution 2 { 3 public: 4 int projectionArea(vector<vector<int>>& grid) 5 { 6 int m = grid.size(),n = grid[0].size(); 7 int res = 0; 8 for(int
阅读全文
posted @ 2020-04-29 18:09 Jinxiaobo0509
阅读(135)
评论(0)
推荐(0)
400. 第N个数字
摘要: 1 // nums[0] = 9; // 1-9 2 // nums[1] = 90*2; // 10-99 3 // nums[2] = 900*3; // 100-999 4 // nums[3] = 9000*4; // 1000-9999 5 // nums[4] = 90000*5; //
阅读全文
posted @ 2020-04-29 16:58 Jinxiaobo0509
阅读(122)
评论(0)
推荐(0)
2020年4月28日
399. 除法求值
摘要: 1 class Solution 2 { 3 public: 4 vector<double> calcEquation(vector<vector<string>> &equations, vector<double> &values, vector<vector<string>> &querie
阅读全文
posted @ 2020-04-28 18:59 Jinxiaobo0509
阅读(137)
评论(0)
推荐(0)
398. 随机数索引
摘要: 1 class Solution 2 { 3 unordered_map<int,vector<int>> hash;// 对应的数 + /下标(可能有重复数)/ 4 public: 5 Solution(vector<int>& nums) 6 { 7 for(int i = 0;i < nums
阅读全文
posted @ 2020-04-28 18:39 Jinxiaobo0509
阅读(84)
评论(0)
推荐(0)
397. 整数替换
摘要: 1 class Solution 2 { 3 public: 4 int integerReplacement(int n) 5 { 6 return DFS(n); 7 } 8 9 long long DFS(long long n) 10 { 11 if(n == 1) return 0; 12
阅读全文
posted @ 2020-04-28 18:24 Jinxiaobo0509
阅读(80)
评论(0)
推荐(0)
396. 旋转函数
摘要: 1 // F[i + 1] - F[i] = sum - n * A[n - 1 - i] 2 class Solution 3 { 4 public: 5 int maxRotateFunction(vector<int>& A) 6 { 7 if(A.empty()) return 0; 8 i
阅读全文
posted @ 2020-04-28 17:53 Jinxiaobo0509
阅读(224)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
38
下一页
公告