Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2015-07-22 22:08:27
阅读次数:
88
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] has the...
分类:
其他好文 时间:
2015-07-22 20:58:27
阅读次数:
127
water~数据不大,枚举首尾即可,也不用高精度。代码如下:#includeint main() { int kase(0), n; while (scanf("%d", &n) == 1) { int s[20]; for (int i = 0; i != n; ++i) scanf("%d", ...
分类:
其他好文 时间:
2015-07-22 13:01:41
阅读次数:
127
最长公共子序列#include#include#include#includeusing namespace std;const int maxn=1111;int dp[maxn][maxn];char s[maxn],t[maxn];int lens,lent;int main(){ in...
分类:
其他好文 时间:
2015-07-22 12:31:44
阅读次数:
74
GP数据库中表结构查询的方法:selectd.nspname,obj_description(d.oid),c.relname,obj_description(c.oid),a.attnum,a.attname,e.data_type,col_description(c.oid,a.attum),e.is_nullable,casewheree.data_type~‘character‘thene.character_maximum_length||‘‘wheree.data_typ..
分类:
数据库 时间:
2015-07-22 11:05:42
阅读次数:
174
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2015-07-21 20:12:55
阅读次数:
97
题目链接:http://poj.org/problem?id=1458
这是一道最长公共子序列的模板题;
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
using namespace std;
/* 最长上升子序列的...
分类:
其他好文 时间:
2015-07-21 17:01:01
阅读次数:
130
115 Distinct Subsequences这道题是dp, 我定义的dp[i][j] 为用t[:i] 和s[:j] 的disitinct subsequence排列数class Solution: # @param {string} s # @param {string} t ...
分类:
其他好文 时间:
2015-07-21 06:48:13
阅读次数:
134
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-07-20 23:00:05
阅读次数:
85