1957

无聊蛋疼的1957写的低端博客
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年8月25日

摘要: = =就是个模拟题class Solution {public: vector > generate(int numRows) { // Start typing your C/C++ solution below // DO NOT write int main() function vector > ans; vector tmp; if(numRows == 0) return ans; tmp.push_back(1); ans.push_back(tmp); fo... 阅读全文

posted @ 2013-08-25 17:48 1957 阅读(191) 评论(0) 推荐(0)

摘要: 简单题,一般的dp入门题。只是要求O(n)的空间,目测是想要求数组迭代吧。但是从上往下推就不用额外空间了PS。写了if没写else都是sb,害得我看这个简单代码调试了10分钟class Solution {public: int minimumTotal(vector > &triangle) { // Start typing your C/C++ solution below // DO NOT write int main() function for(int i = 1 ; i < triangle.size() ; i++){ ... 阅读全文

posted @ 2013-08-25 12:52 1957 阅读(302) 评论(0) 推荐(0)