
线性DP
lizhaowei213
活着就为改变世界!
展开
-
HDU 1028 Ignatius and the Princess III
A - Ignatius and the Princess IIITime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescription"Well, it seems the first problem is too easy. I will原创 2015-08-22 16:28:19 · 245 阅读 · 0 评论 -
POJ 2533 Longest Ordered Subsequence
Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 42063 Accepted: 18507DescriptionA numeric sequence of ai is ordered ifa1 a2 a原创 2016-01-23 17:45:56 · 340 阅读 · 0 评论 -
HDU 1087 Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30775 Accepted Submission(s): 13787Problem Descri原创 2016-03-25 12:23:34 · 351 阅读 · 0 评论 -
hihoCoder 1037 数字三角形
#1037 : 数字三角形时间限制:10000ms单点时限:1000ms内存限制:256MB问题描述小Hi和小Ho在经历了螃蟹先生的任务之后被奖励了一次出国旅游的机会,于是他们来到了大洋彼岸的美国。美国人民的生活非常有意思,经常会有形形色色、奇奇怪怪的活动举办,这不,小Hi和小Ho刚刚下飞机,就赶上了当地的迷宫节活动。迷宫节里展览出来的迷原创 2016-03-22 14:22:29 · 436 阅读 · 0 评论 -
SCU 1114 数字三角
C - 数字三角Time Limit:0MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice SCU 1114 Description下图是个数字三角,请编写一个程序计算从顶部至底部某处一条路径,使得该路径所经过的数字总和最大。73 88原创 2016-02-01 23:19:16 · 531 阅读 · 0 评论 -
POJ 3671 Dining Cows
Dining CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7758 Accepted: 3282DescriptionThe cows are so very silly about their dinner partners. They原创 2016-01-23 12:45:01 · 775 阅读 · 0 评论 -
POJ 1036 Gangsters
GangstersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11992 Accepted: 3352DescriptionN gangsters are going to a restaurant. The i-th gangster comes at原创 2015-12-04 16:24:44 · 463 阅读 · 0 评论 -
hihoCoder 1239 Fibonacci
#1239 : Fibonacci时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of fibonacci sequence.A sub-sequence is a seq原创 2015-10-14 21:08:32 · 754 阅读 · 0 评论 -
POJ 1458 Common Subsequence
Common SubsequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 43638 Accepted: 17765DescriptionA subsequence of a given sequence is the given sequence原创 2015-09-06 16:09:32 · 307 阅读 · 0 评论 -
ZOJ 1093 Monkey and Banana
F - Monkey and BananaTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusPracticeZOJ 1093DescriptionA group of researchers are designing an experiment原创 2015-09-09 00:20:12 · 525 阅读 · 0 评论 -
UVA 10723 Cyborg Genes
这题最后就是求两个数,一个是由双亲序列得到的子序列的长度,还有一个是总共的方法数。第一个数按照LCS的DP方法求,最后的结果是两个串长度之和减去LCS的长度。第二个怎么求呢,困扰了好久,后来想明白了。num[i][j]表示从表示a串前i个元素和b串前j个元素所能得到的方法数。若p1[i]=p2[j],那么c[i][j]=c[i-1][j-1],即p1串前i-1个元素和p2串前j-1个元素得到的原创 2015-08-10 10:16:54 · 536 阅读 · 0 评论 -
UVA 10271 Chopsticks
点击打开题目链接题目大概意思是说给出k和n, 然后给出n根筷子从小到大给出, 现在要从这n根筷子中选出k + 8组筷子, 每组筷子包括三根, 现在要求所有k+8组每组筷子中最短两根筷子之差的平方的和最小,输出最小值。DP因为输入的筷子长度是有序的。所以一组筷子里面那两根小的一定是连续的两个。a[i]和a[i-1].从大到小排序考虑。可以排除C的干扰。#include #i原创 2015-08-25 09:12:03 · 380 阅读 · 0 评论 -
Code Forces 313B Ilya and Queries
C - CTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 313BDescriptionIlya the Lion wants to help all his friends with passi原创 2015-08-24 12:49:57 · 632 阅读 · 0 评论 -
CSU 1560 图书管理员的表白方式
1560: 图书管理员的表白方式Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 114 Solved: 36[Submit][Status][Web Board]Description小V是中南大学图书馆的图书管理员,每天要整理很多同学们还回来的书。久而久之,他认识了很多常来图书馆的同学,比如说小L。简而言之吧,就是小原创 2016-04-16 00:22:16 · 850 阅读 · 0 评论