
ACM_DP
kewlgrl
好大一只咸鱼哇
展开
-
POJ-2192 Zipper-DP-字符串
ZipperTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17232 Accepted: 6131DescriptionGiven three strings, you are to determine whether the third string转载 2015-08-19 18:36:35 · 645 阅读 · 0 评论 -
POJ 1239-Increasing Sequences(LIS 分割成上升序列-两次DP)
Increasing SequencesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3089 Accepted: 1179DescriptionGiven a string of digits, insert commas to create a se原创 2016-05-21 13:10:25 · 1997 阅读 · 0 评论 -
多重部分和问题
问题及代码:有n种不同大小的数字a[i],每种各m[i]个。判断是否可以从这些数字之中选出若干使它们的和恰好为K。#include#include#include#includeusing namespace std;#define MAXN 10010int n,K,a[MAXN],m[MAXN];bool dp[MAXN][MAXN];void solve(原创 2016-05-21 20:09:34 · 798 阅读 · 0 评论 -
POJ 2392-Space Elevator(多重部分和-多重背包)
Space ElevatorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10506 Accepted: 4994DescriptionThe cows are going to space! They plan to achieve orbit by原创 2016-05-21 19:53:16 · 917 阅读 · 0 评论 -
HDU 1159-Common Subsequence(LCS 最长公共子序列)
Common SubsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32746 Accepted Submission(s): 14818Problem DescriptionA subsequ原创 2016-05-18 19:00:08 · 857 阅读 · 0 评论 -
POJ 1276-Cash Machine(多重部分和-dp)
Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34117 Accepted: 12362DescriptionA Bank plans to install a machine for cash withdrawal. The m原创 2017-02-09 20:10:29 · 493 阅读 · 0 评论 -
POJ 1837-Balance(01背包-天平平衡)
BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 14034 Accepted: 8824DescriptionGigel has a strange "balance" and he wants to poise it. Actually原创 2017-02-09 20:37:34 · 602 阅读 · 0 评论 -
POJ 1260-Pearls(DP-买珍珠)
PearlsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9084 Accepted: 4571DescriptionIn Pearlania everybody is fond of pearls. One company, called The Ro原创 2017-02-28 21:09:02 · 539 阅读 · 0 评论 -
POJ 3903-Stock Exchange/POJ 2533-Longest Ordered Subsequence(LIS-最长递增子序列长度)
Stock ExchangeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6647 Accepted: 2342DescriptionThe world financial crisis is quite a subject. Some people a原创 2017-02-28 21:16:23 · 555 阅读 · 0 评论 -
POJ 1836-Alignment(LIS-士兵列队)
AlignmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 16527 Accepted: 5424DescriptionIn the army, a platoon is composed by n soldiers. During the mor原创 2017-02-28 21:34:01 · 590 阅读 · 0 评论 -
POJ 3176-Cow Bowling/POJ 1163-The Triangle(简单DP-数塔)
Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18487 Accepted: 12308DescriptionThe cows don't use actual bowling balls when they go bowlin原创 2017-02-24 17:05:08 · 504 阅读 · 0 评论 -
病毒(LICS 最长上升公共子序列)
你有一个日志文件,里面记录着各种系统事件的详细信息。自然的,事件的时间戳按照严格递增顺序排列(不会有两个事件在完全相同的时刻发生)。遗憾的是,你的系统被病毒感染了,日志文件中混入了病毒生成的随机伪事件(但真实事件的相对顺序保持不变)。备份的日志文件也被感染了,但由于病毒采用的随机感染方法,主日志文件和备份日志文件在感染后可能会变得不一样。给出被感染的主日志和备份日志,求真实事件序列的最长可原创 2017-04-09 11:41:53 · 763 阅读 · 0 评论 -
POJ 3368-Frequent values(RMQ+离散化-最频繁的元素)
Frequent valuesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 18533 Accepted: 6692DescriptionYou are given a sequence of n integers a1 , a2 , ... , an原创 2017-04-12 17:36:46 · 629 阅读 · 0 评论 -
POJ 1579-Function Run Fun(记忆化搜索-递归)
Function Run FunTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18930 Accepted: 9612DescriptionWe all love recursion! Don't we? Consider a three-par原创 2017-04-28 18:38:09 · 690 阅读 · 0 评论 -
POJ 3264-Balanced Lineup(RMQ-ST算法)
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 51826 Accepted: 24285Case Time Limit: 2000MSDescriptionFor the daily milking, Far原创 2017-04-05 16:20:14 · 496 阅读 · 0 评论 -
POJ 1050-To the Max(最大子矩阵和)
To the MaxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 48640 Accepted: 25719DescriptionGiven a two-dimensional array of positive and negative integer原创 2017-04-25 10:24:07 · 557 阅读 · 0 评论 -
POJ 1080-Human Gene Functions(LCS变形-最大得分)
Human Gene FunctionsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18697 Accepted: 10386DescriptionIt is well known that a human gene can be considered原创 2016-05-19 21:44:10 · 918 阅读 · 0 评论 -
HDU 2844-Coins(多重背包)
CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11770 Accepted Submission(s): 4686Problem DescriptionWhuacmers use coins.The原创 2016-05-18 18:43:48 · 542 阅读 · 0 评论 -
ZOJ 3872-Beauty of Array(递推||DP)
Beauty of ArrayTime Limit: 2 Seconds Memory Limit: 65536 KB Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the arr原创 2016-04-05 20:15:16 · 548 阅读 · 0 评论 -
YT05-动态归划求解课后题目-1004—Max Sum -(6.21日-烟台大学ACM预备队解题报告)
Max Sum Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 10 Accepted Submission(s) : 9Font: Times New Roman | Verdana | Georgia Font Size原创 2015-07-15 16:48:00 · 820 阅读 · 0 评论 -
YT05-动态归划求解课后题目-1001—FatMouse's Speed-(6.21日-烟台大学ACM预备队解题报告)
FatMouse's Speed Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 22 Accepted Submission(s) : 12Special Judge Font: Times New Roman | Ver原创 2015-07-15 16:37:20 · 981 阅读 · 0 评论 -
YT05-动态归划求解课堂题目-1004—最少拦截系统-(6.21日-烟台大学ACM预备队解题报告)
最少拦截系统 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 47 Accepted Submission(s) : 19Font: Times New Roman | Verdana | Georgia Font Size原创 2015-07-15 16:29:58 · 1024 阅读 · 0 评论 -
YT05-动态归划求解课堂题目-1003—数塔-(6.21日-烟台大学ACM预备队解题报告)
Humble Numbers Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 30 Accepted Submission(s) : 13Font: Times New Roman | Verdana | Georgia F原创 2015-07-15 16:23:35 · 666 阅读 · 0 评论 -
HDU 2602-Bone Collector(01背包-一/二维)
Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 47666 Accepted Submission(s): 19880Problem DescriptionMany years ag原创 2016-05-14 09:32:07 · 651 阅读 · 0 评论 -
POJ 2686-Traveling by Stagecoach(DAG图-状态压缩DP)
Traveling by StagecoachTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2802 Accepted: 1010 Special JudgeDescriptionOnce upon a time, there was a tra原创 2016-05-27 20:13:03 · 701 阅读 · 0 评论 -
NYIST 737-石子合并(区间DP)
石子合并(一)时间限制:1000 ms | 内存限制:65535 KB难度:3描述 有N堆石子排成一排,每堆石子有一定的数量。现要将N堆石子并成为一堆。合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆。求出总的代价最小值。输入有多组测试数据,输入到文件结束。每组测试数据第一行有一个整数n,表示有n堆石子。原创 2016-05-28 08:57:33 · 598 阅读 · 0 评论 -
POJ 2955-Brackets(括号匹配-区间DP)
BracketsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5484 Accepted: 2946DescriptionWe give the following inductive definition of a “regular bracket原创 2016-05-28 10:09:31 · 3115 阅读 · 0 评论 -
YOJ 2335-0-1背包问题(输出最优装入方案)
2335: 0-1背包问题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 98 Solved: 61[Submit][Status][Web Board]Description 试设计一个用回溯法搜索子集空间树的函数。该函数的参数包括结点可行性判定函数和上界函数等必要的函数,并将此函数用于解0-1背包问题。 0-1 背包原创 2016-05-28 10:30:53 · 2624 阅读 · 0 评论 -
HDU 2159-FATE(完全背包)
FATETime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11420 Accepted Submission(s): 5407Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到原创 2016-05-15 20:04:10 · 3309 阅读 · 1 评论 -
HDU 2089-不要62(数位DP)
不要62Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32028 Accepted Submission(s): 11366Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:l原创 2016-05-29 10:02:26 · 937 阅读 · 0 评论 -
HDU 4734-F(x)(数位DP)
F(x)Time Limit: 1000/500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3567 Accepted Submission(s): 1330Problem DescriptionFor a decimal number x w原创 2016-05-29 19:24:39 · 650 阅读 · 0 评论 -
HDU 2955-Robberies(01背包变形)
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19371 Accepted Submission(s): 7149Problem DescriptionThe aspiring Roy th原创 2016-05-14 18:40:22 · 1053 阅读 · 0 评论 -
【DP专辑】ACM动态规划总结
动态规划一直是ACM竞赛中的重点,同时又是难点,因为该算法时间效率高,代码量少,多元性强,主要考察思维能力、建模抽象能力、灵活度。本人动态规划博客地址:http://blog.youkuaiyun.com/cc_again/article/category/1261899******************************************************************转载 2016-04-22 18:05:59 · 611 阅读 · 0 评论 -
最长回文子序列(不连续) 可输出回文序列
string LCS(string str1,string str2)//str2是str1的逆序{ string fin=str1; int length1,length2; int arr[MAXN][MAXN]; length1 = str1.length(); length2 = str2.length(); memset(arr,0,s...原创 2019-04-03 21:18:46 · 1484 阅读 · 1 评论