<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><linkrel="stylesheet" href="../../../ui/jquery.mobile-1.4.5/jquery.mo..
分类:
Web程序 时间:
2015-02-02 19:59:19
阅读次数:
246
/*
裸lcs(最大公共子序列)
*/
# include
# include
# include
# include
using namespace std;
int c[1010][1010];
int main()
{
int i,j,lena,lenb;
char a[1010],b[1010];
while(~scanf("%s%s",a,b))
...
分类:
其他好文 时间:
2015-02-02 14:13:47
阅读次数:
98
A - Maximum in Table
纯递推。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define LL __int64
#define pi acos(-1.0)
const int mod...
分类:
其他好文 时间:
2015-02-02 12:37:06
阅读次数:
135
原题地址二叉树的遍历代码:1 int maxDepth(TreeNode *root) {2 if (!root)3 return 0;4 return max(maxDepth(root->left), maxDepth(root->righ...
分类:
其他好文 时间:
2015-02-02 12:21:50
阅读次数:
132
Description
A numeric sequence of ai is ordered if a1 a2 <
... aN. Let the subsequence of the given numeric sequence (a1, a2,
..., aN) be any sequence (ai1, ai2,
..., aiK), where 1 i1 i2 <
...
分类:
其他好文 时间:
2015-02-02 10:54:35
阅读次数:
145
A. Maximum in Table题意:给定一个表格,它的第一行全为1,第一列全为1,另外的数满足a[i][j]=a[i-1][j]+a[i][j-1],求这个表格中的最大的数a[n][n]即为最大的数#include #include #include #include using n...
分类:
其他好文 时间:
2015-02-01 12:03:20
阅读次数:
275
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-02-01 10:46:16
阅读次数:
251
链接:click here
题意:tip:最长公共子序列也称作最长公共子串(不要求连续),英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。
输入第一行给出一个整数N(0
接下来每组数据两行,分别为待测的两组字符串。每个字符串长度不大于...
分类:
其他好文 时间:
2015-01-31 23:19:56
阅读次数:
323
Maximum path sum II
Problem 67
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9...
分类:
编程语言 时间:
2015-01-31 13:06:41
阅读次数:
185
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line. 1 import java.util.HashMap; 2 import java.util.Itera...
分类:
其他好文 时间:
2015-01-30 21:04:34
阅读次数:
169