qingcheng奕  

2014年6月17日

摘要: https://oj.leetcode.com/problems/unique-paths/首先,转换成一个排列组合问题,计算组合数C(m+n-2) (m-1),请自动想象成上下标。class Solution {public: int uniquePaths(int m, int n) { ... 阅读全文
posted @ 2014-06-17 20:01 qingcheng奕 阅读(169) 评论(1) 推荐(0) 编辑
 
摘要: https://oj.leetcode.com/problems/path-sum-ii/树的深搜,从根到叶子,并记录符合条件的路径。注意参数的传递,是否需要使用引用。#include #include using namespace std;struct TreeNode { int va... 阅读全文
posted @ 2014-06-17 09:45 qingcheng奕 阅读(170) 评论(0) 推荐(0) 编辑