原题地址基本动态规划题代码: 1 int uniquePaths(int m, int n) { 2 vector sum(n, 0); 3 4 sum[n - 1] = 1; 5 for (int i = m - 1; i >= 0...
分类:
其他好文 时间:
2015-01-27 19:55:39
阅读次数:
238
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of
S is 1000, and there exists one unique longest palindromic substring.(最长回文子串)
中心扩展法:
pub...
分类:
其他好文 时间:
2015-01-27 18:31:08
阅读次数:
151
【题目】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be chosen from C unli...
分类:
其他好文 时间:
2015-01-27 18:23:32
阅读次数:
194
【题目】
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
Each number in C may only be used once in t...
分类:
其他好文 时间:
2015-01-27 18:21:00
阅读次数:
180
题目:Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
下面是英文,祝你好运
...
分类:
其他好文 时间:
2015-01-27 16:35:09
阅读次数:
363
http://poj.org/problem?id=1679
The Unique MST
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 21550
Accepted: 7619
Description
Given a connected...
分类:
其他好文 时间:
2015-01-27 15:05:39
阅读次数:
169
次小生成树模板
通过poj 1679
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define INF 10000000
/*
* 次小生成树
* 求最小生成树时,用数组Max[i][j]来表示MST中i到j最大边权
...
分类:
其他好文 时间:
2015-01-27 15:05:28
阅读次数:
119
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
#include
#includ...
分类:
其他好文 时间:
2015-01-27 15:02:38
阅读次数:
164
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:
其他好文 时间:
2015-01-27 14:50:17
阅读次数:
198
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For e...
分类:
其他好文 时间:
2015-01-27 13:28:19
阅读次数:
149