摘要:
/*比较简单的动态规划*/class Solution {public: int minPathSum(vector > &grid) { int row = grid.size(); int col = grid[0].size(); for(int... 阅读全文
摘要:
/*最大连续子序列*/class Solution {public: int maxSubArray(int A[], int n) { if(!n) return 0; int result = A[0],temp =0 ; for(int i = ... 阅读全文
摘要:
/*题意:有一排房子,每个房子里有一些钱,每两个相连房子只能取一个,问取得的最大的钱数是多少? */class Solution {public: int rob(vector &num) { int len = num.size(),num1 = 0,num2 = 0,temp... 阅读全文