Minimum Inversion Number Time Limit:1000MS Memory
Limit:32768KB 64bit IO Format:%I64d & %I64u Description The inversion number
of a given number seque...
分类:
其他好文 时间:
2014-05-04 12:27:07
阅读次数:
349
这道题,采用动态规划算法。from top to
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path
sum from top to bottom. 3 * Each ...
分类:
其他好文 时间:
2014-05-02 12:19:23
阅读次数:
382
Given a strings, partitionssuch that every
substring of the partition is a palindrome.Return the minimum cuts needed for a
palindrome partitioning ofs...
分类:
其他好文 时间:
2014-05-01 14:47:09
阅读次数:
409
思路很简单,就是存储之前运算的结果,然后递归class Solution {public: int**
dp; int get_min_sum(vector > &grid, int m, int n) { if (dp[m][n] != -1)
...
分类:
其他好文 时间:
2014-05-01 07:54:47
阅读次数:
330
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-04-28 10:46:41
阅读次数:
311