dp
文章平均质量分 85
ZSGG_ACM
既然选择了ACM了,那就好好爱它,不管风雨兼程.
展开
-
C. Boredom (简单的一维DP)
C. Boredomtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlex doesn't like boredom. That's why whenever he gets bore原创 2014-08-16 20:16:09 · 1695 阅读 · 0 评论 -
1376 最长递增子序列的数量(线段树加DP)
萌萌哒的链接题解:题目在求一串序列的最长递增子序列的基础上,再求其数量。看到题目的数的范围,一眼就应该想到先离散。离散完后,再仔细想想,咦,不是可以用n^2的dp做吗? 对于序列的第i位,其最优子结构为求出值比a[i]小的且当前最长递增子序列是最大的。然后我们再加个计数就行了?。。。。事实证明这个不妥,因为题目的序列最大有50000,n^2的算法一秒之内肯定过不了。于是我们原创 2016-01-05 20:30:10 · 1162 阅读 · 0 评论 -
郑大第九届校赛正式赛(1819: 加加加!(油))
1819: 加加加!(油)Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 72 Solved: 42SubmitStatusWeb BoardDescription实验室的小D同学又开始玩游戏了,这次他的游戏貌似很高级的样子。首先他在一张纸上写下了一个数n,然后他在两个无差别的球上写上两个数分别是a和b,他把两个球放在一个原创 2015-12-09 13:40:09 · 893 阅读 · 0 评论 -
1233 - Coin Change (III)
1233 - Coin Change (III) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBIn a strange shop there are n types of coins of val原创 2015-11-04 13:06:32 · 563 阅读 · 0 评论 -
lightOJ 1205(Palindromic Numbers数位DP)
Palindromic Numbers Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionA palindromic number or numeral palindrome is a ‘symmetrical’ number like 16原创 2015-08-28 10:25:07 · 1264 阅读 · 0 评论 -
ACboy needs your help(DP)
ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4542 Accepted Submission(s): 2431Problem DescriptionACboy原创 2015-02-10 21:24:48 · 695 阅读 · 0 评论 -
Constructing Roads In JGShining's Kingdom(最长上升子序列)
Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16956 Accepted Submission(s): 4819Proble原创 2015-01-23 00:03:12 · 652 阅读 · 0 评论 -
Monkey and Banana(DAG上的动态规划问题)
Monkey and BananaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8122 Accepted Submission(s): 4194Problem DescriptionA group of原创 2015-01-22 14:41:21 · 970 阅读 · 0 评论 -
Heavy Transportation (dp)
C - Heavy TransportationTime Limit:3000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBackground Hugo Heavy is happy. After the breakdown of the原创 2015-02-05 22:06:26 · 495 阅读 · 0 评论 -
寒假训练DP
一.区间DPD -PalindromeTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionA palindrome is a symmetrical string, that is, a string read identically f原创 2014-12-20 17:50:16 · 826 阅读 · 0 评论 -
Dollars(简单DP)
J - DollarsTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmitStatusDescription Dollars New Zealand currency consists of $100, $50, $20, $10,原创 2014-09-01 15:33:51 · 895 阅读 · 0 评论 -
Square Coins(dp-母函数)
Square CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8307 Accepted Submission(s): 5648Problem DescriptionPeople in Sil原创 2014-08-31 16:34:32 · 1371 阅读 · 0 评论 -
1154 回文串划分
萌萌哒的链接题解:O(n^2)的算法! 用O(n^2)的dp预处理出哪些区间是回文的,然后O(n)求出答案(dp[i]表示前i个字符最小的回文划分)! 然后预处理还可以再优化,用马拉车来优化可以更快。代码来了://package xdlove_acmer;import java.text.DecimalFormat;import java.util.*;import j原创 2015-12-21 21:00:35 · 481 阅读 · 0 评论