码迷,mamicode.com
首页 >  
搜索关键字:combination sum ii    ( 27716个结果
[问题2014S15] 复旦高等代数II(13级)每周一题(第十五教学周)
[问题2014S15] 设 \(O\) 为 \(n\) 阶正交阵,\(A=\mathrm{diag}\{a_1,a_2,\cdots,a_n\}\) 为实对角阵, 证明: 方阵 \(OA\) 的特征值 \(\lambda_j\) 适合不等式: \[m\leq |\lambda_j|\leq M,\,...
分类:其他好文   时间:2014-06-02 20:45:15    阅读次数:246
UESTC 887 方伯伯的儿童节
树形DP问题。定义:1.dp[u][1]表示u这个点设立糖果发放点且u这棵子树满足条件时的最少糖果点数2.dp[u][0]表示u这个点不设立发放点且u这棵子树满足条件时的最少糖果点数设v1,v2……vn为u的子节点,则转移方程:dp[u][1]= sum(min(dp[vi][1],dp[vi][0...
分类:其他好文   时间:2014-06-02 20:35:30    阅读次数:262
UESTC 886 方老师金币堆
环状合并石子问题。环状无非是第n个要和第1个相邻。可以复制该行石子到原来那行的右边即可达到目的。定义:dp[i][j]代表从第i堆合并至第j堆所要消耗的最小体力。转移方程:dp[i][j]=min(dp[i][k]+dp[k+1][j]+sum[i][j]);复杂度:O(n^3)。可考虑四边形优化。...
分类:其他好文   时间:2014-06-02 20:34:03    阅读次数:226
UESTC 876 爱管闲事
题意:即求给定n个数字(a1,a2,……an),不改变序列,分成M份,使每一份和的乘积最大。思路:dp[i][j]表示把前i个数字,分成j份所能得到的最大乘积。转移方程:dp[i][j] = max{ dp[k][i-1]*sum(k+1,j) } 其中显然j#include #include #i...
分类:其他好文   时间:2014-06-02 19:58:45    阅读次数:242
几道算法题
1.Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-...
分类:其他好文   时间:2014-06-02 17:36:53    阅读次数:234
LeetCode: Unique Binary Search Trees II [096]
【题目】 Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. 1 3 3 2 1 \ / / / \ ...
分类:其他好文   时间:2014-06-01 15:33:45    阅读次数:297
LeetCode: Reverse Linked List II [092]
【题目】 Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n satisfy the following condition: 1 ≤ m ≤ n ≤ length of list. 【题意】 ...
分类:其他好文   时间:2014-06-01 15:08:34    阅读次数:237
ZJ2008树的统计(树链剖分)
type node1=record go,next:longint;end; node2=record l,r,mx,sum:longint;end;var i,x,y,n,q,tmp,cnt,sz,code:longint; ch,st:string; fa:a...
分类:其他好文   时间:2014-06-01 11:45:18    阅读次数:374
projecteuler---->problem=13----Large sum
title: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 4637693767749000971264812489697007805041701826053...
分类:其他好文   时间:2014-06-01 08:53:33    阅读次数:276
LeetCode: Subsets II [091]
【题目】 Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. For example, If S = [1,2,2], a solution ...
分类:其他好文   时间:2014-06-01 08:51:06    阅读次数:292
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!