上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 38 下一页
摘要: 1 class Solution 2 { 3 public: 4 int uniquePaths(int m, int n) 5 { 6 vector<vector<int>> dp(m,vector<int>(n,1)); 7 for(int i = 1;i < m;i ++) 8 { 9 for 阅读全文
posted @ 2020-03-19 19:43 Jinxiaobo0509 阅读(73) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 void spilt(string s,char c,vector<string> &res) 4 { 5 istringstream iss(s); 6 string temp; 7 while(getline(iss,temp,c)) 8 { 9 / 阅读全文
posted @ 2020-03-19 19:20 Jinxiaobo0509 阅读(111) 评论(0) 推荐(0)
摘要: 1 //spilt函数的实现 2 //假设以空格切分:char c = ' '; 3 class Solution 4 { 5 vector<string> res; 6 void spilt(string s,char c,vector<string> &res) 7 { 8 istringstr 阅读全文
posted @ 2020-03-19 19:18 Jinxiaobo0509 阅读(172) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 public: 4 vector<vector<int>> merge(vector<vector<int>>& nums) 5 { 6 vector<vector<int>> res; 7 if(nums.empty()) return res; 8 阅读全文
posted @ 2020-03-19 18:39 Jinxiaobo0509 阅读(112) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 public: 4 bool canJump(vector<int>& nums) 5 { 6 int n = nums.size(); 7 int max_size = nums[0]; 8 for(int i = 0;i < n;i ++) 9 { 阅读全文
posted @ 2020-03-19 18:07 Jinxiaobo0509 阅读(97) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 vector<int> ans; 4 public: 5 vector<int> spiralOrder(vector<vector<int>>& matrix) 6 { 7 if(matrix.size() == 0) return {}; 8 int 阅读全文
posted @ 2020-03-19 18:04 Jinxiaobo0509 阅读(105) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 public: 4 int longestCommonSubsequence(string text1, string text2) 5 { 6 int m = text1.size(); 7 int n = text2.size(); 8 vector 阅读全文
posted @ 2020-03-19 16:13 Jinxiaobo0509 阅读(103) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 public: 4 int findNumberOfLIS(vector<int>& nums) 5 { 6 if(nums.size() == 0) return 0; 7 int n = nums.size(); 8 vector<int> dp(n 阅读全文
posted @ 2020-03-19 15:58 Jinxiaobo0509 阅读(129) 评论(0) 推荐(0)
摘要: 1 class Solution 2 { 3 public: 4 int lengthOfLIS(vector<int>& nums) 5 { 6 if(nums.size() == 0) return 0; 7 int n = nums.size(); 8 int res = INT_MIN; 9 阅读全文
posted @ 2020-03-19 12:56 Jinxiaobo0509 阅读(103) 评论(0) 推荐(0)
摘要: 1 //看成一个下三角形 2 class Solution 3 { 4 public: 5 int minimumTotal(vector<vector<int>>& triangle) 6 { 7 int n = triangle.size(); 8 int res = INT_MAX; 9 ve 阅读全文
posted @ 2020-03-19 11:39 Jinxiaobo0509 阅读(165) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 38 下一页