随笔分类 - ACM之dp
摘要:http://acm.uestc.edu.cn/#/problem/show/32树上战争(Battle on the tree)Time Limit: 12000/4000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Subm...
阅读全文
摘要:http://acm.uestc.edu.cn/#/problem/show/31饭卡(card)Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus电子科大本部食堂的...
阅读全文
摘要:可做hdu2602:http://acm.hdu.edu.cn/showproblem.php?pid=2602代码1:#include #include #include #include #include #include using namespace std;#define N 1007in...
阅读全文
摘要:http://acm.nyist.net/JudgeOnline/problem.php?pid=36最长公共子序列时间限制:3000ms | 内存限制:65535KB难度:3描述咱们就不拐弯抹角了,如题,需要你做的就是写一个程序,得出最长公共子序列。tip:最长公共子序列也称作最长公共子串(不要求...
阅读全文
摘要:http://ac.jobdu.com/problem.php?pid=1533题目描述:给定一个整型数组, 求这个数组的最长严格递增子序列的长度。 譬如序列1 2 2 4 3 的最长严格递增子序列为1,2,4或1,2,3.他们的长度为3。输入:输入可能包含多个测试案例。对于每个测试案例,输入的第一...
阅读全文
摘要:首先来个题目链接:http://acm.uestc.edu.cn/#/problem/show/886题目:方老师金币堆Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStat...
阅读全文
摘要:首先来个题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=737有个更难的版本(不过很好玩):http://www.lydsy.com/JudgeOnline/problem.php?id=3229题目:石子合并(一)时间限制:1000ms ...
阅读全文
摘要:1.数字三角形问题1:• 7• 3 8• 8 1 0• 2 7 4 4•4 5 2 6 5•从第一层走到最后一层,每次向左下或右下走,求路径的最大权值和。思路:•如果利用转移方程求解原问题?•f[i][j]=max(f[i+1][j],f[i+1][j+1])+a[i][j]•1、从上向下转移,即...
阅读全文
摘要:http://poj.org/problem?id=1088滑雪Time Limit:1000MSMemory Limit:65536KTotal Submissions:79806Accepted:29701DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获...
阅读全文
摘要:http://acm.nyist.net/JudgeOnline/problem.php?pid=1076方案数量时间限制:1000ms | 内存限制:65535KB难度:2描述给出一个N*M的棋盘,左下角坐标是(0,0),右上角坐标是(N,M),规定每次只能向上或者向右走,问从左下角走到右上角,一...
阅读全文