
DP
文章平均质量分 79
cyendra
Azarath Metrion Zinthos
展开
-
UVa 11137 - Ingenuous Cubrency 背包
Problem I: Ingenuous CubrencyPeople in Cubeland use cubic coins. Not only the unit of currency is called acube but also the coins are shaped like cubes and their values are cubes. Coins with value原创 2013-05-03 15:19:40 · 845 阅读 · 0 评论 -
MUTC 1 A - Divide Chocolate 方案统计DP
Divide ChocolateTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1271 Accepted Submission(s): 604Problem DescriptionIt is well原创 2013-05-29 10:49:32 · 814 阅读 · 0 评论 -
MUTC 2 A - Hero 状态压缩dp
HeroTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1869 Accepted Submission(s): 868Problem DescriptionWhen playing DotA with原创 2013-06-01 16:42:19 · 783 阅读 · 0 评论 -
MUTC 2 E - Save the dwarfs DP?
Save the dwarfsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 934 Accepted Submission(s): 285Problem DescriptionSeveral dwar原创 2013-06-02 20:58:29 · 718 阅读 · 0 评论 -
Uva 10891 - Game of Sum dp博弈
Problem EGame of SumInput File: e.inOutput: Standard Output This is a two player game. Initially there are n integer numbers in an array and players A and B get chance to take them alternati原创 2013-06-03 09:58:11 · 1064 阅读 · 0 评论 -
Uva 11825 - Hackers' Crackdown 状态压缩
Problem HHackers’ Crackdown Input: Standard InputOutput: Standard Output Miracle Corporations has a number of system services running in a distributed computer system which is a prime targ原创 2013-06-03 10:42:59 · 958 阅读 · 0 评论 -
MUTC 3 D - Magic Number DP
Magic NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1113 Accepted Submission(s): 480Problem DescriptionThere are many原创 2013-06-13 10:49:38 · 693 阅读 · 0 评论 -
Uva 10859 - Placing Lampposts 树形dp
Input: Standard InOutput: Standard OutNext Generation Contest 1 Time Limit: 2 secondsProblem DPlacing LamppostsAs a part of the mission �Beautificat原创 2013-06-03 15:56:23 · 1238 阅读 · 0 评论 -
Uva 11552 - Fewest Flops 字符串dp
Problem FFEWEST FLOPSA common way to uniquely encode a string is by replacing its consecutive repeating characters (or “chunks”) by the number of times the character occurs followed by the原创 2013-06-04 10:41:38 · 1117 阅读 · 0 评论 -
Uva 1456 - Cellular Network 概率dp
A cellular network is a radio network made up of a number of cells each served by a base station located in the cell. The base station receives call signals from mobile users (mobiles) in the cell i原创 2013-06-04 11:48:23 · 898 阅读 · 0 评论 -
MUTC 1 B - Hourai Jeweled 树形dp?
Hourai JeweledTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 810 Accepted Submission(s): 291Problem DescriptionKaguya Hour原创 2013-05-30 16:18:40 · 717 阅读 · 0 评论 -
UVa 10723 - Cyborg Genes LCS
Problem FCyborg GenesTime Limit1 SecondSeptember 11, 2132.This is the day that marks the beginning of the end – the end of you the miserable humans. For years you h原创 2013-05-09 21:12:09 · 1168 阅读 · 0 评论 -
UVa 10154 - Weights and Measures dp 降维
Problem F: Weights and MeasuresI know, up on top you are seeing great sights, But down at the bottom, we, too, should have rights. We turtles can't stand it. Our shells will all crack! Besides原创 2013-05-03 19:49:48 · 1364 阅读 · 0 评论 -
UVa 10453 - Make Palindrome 字符串dp
Problem AMake PalindromeInput: standard inputOutput: standard outputTime Limit: 8 seconds By definition palindrome is a string which is not changed when reversed. "MADAM" is a nice example原创 2013-05-03 20:35:33 · 968 阅读 · 0 评论 -
UVa 10911 - Forming Quiz Teams 状态压缩dp
4th IIUC Inter-University Programming Contest, 2005GForming Quiz TeamsInput: standard inputOutput: standard outputProblemsetter: Sohel HafizYou have原创 2013-05-04 20:42:15 · 931 阅读 · 0 评论 -
NEFU 696 Dart game 背包dp
Dart gameTime Limit 1000msMemory Limit 65536Kdescription Darts originated in Australia. Australia's aborigines initially for hunting and hit原创 2013-05-05 20:02:23 · 961 阅读 · 0 评论 -
NEFU 698 Post office 大概是dp?
Post officeTime Limit 1000msMemory Limit 65536KdescriptionThere are N(N input For each test case, the first line i原创 2013-05-05 20:08:37 · 849 阅读 · 0 评论 -
Hdu 4545 魔法串 字符串dp
魔法串Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 474 Accepted Submission(s): 200Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西原创 2013-05-20 11:12:11 · 724 阅读 · 0 评论 -
zoj 3703 Happy Programming Contest 不平常的01背包
Happy Programming ContestTime Limit: 2 Seconds Memory Limit: 65536 KBIn Zhejiang University Programming Contest, a team is called "couple team" if it consists of only two students lovin原创 2013-05-07 17:19:38 · 1288 阅读 · 0 评论 -
CodeForces 73C LionAge II Dp
DescriptionVasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character原创 2013-05-08 21:02:19 · 888 阅读 · 0 评论 -
UVa 10913 - Walking on a Grid dp
4th IIUC Inter-University Programming Contest, 2005IWalking on a GridInput: standard inputOutput: standard outputProblemsetter: Sohel HafizYou will原创 2013-05-09 17:57:19 · 869 阅读 · 1 评论 -
Uva 1292 - Strategic game 树形dp 最小点覆盖
Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieva原创 2013-06-05 10:17:07 · 1302 阅读 · 0 评论 -
UVa在线比赛单题汇总-----DP专题
动态规划基础例题LA 3882UVa 3882 - And Then There Was One 递推------------无力orzUVa 1063510635 - Prince and Princess LCS&LISUVa 10891Uva 10891 - Game of Sum dp博弈UVa 11825Uva 11825 - Ha原创 2013-04-21 21:29:25 · 3147 阅读 · 3 评论 -
SPOJ 7758 Growing Strings AC自动机DP
7758. Growing StringsProblem code: MGLAR10 EnglishVietnamese Gene and Gina have a particular kind of farm. Instead of growing a原创 2013-09-05 16:43:58 · 1112 阅读 · 0 评论 -
hdu 4745 Two Rabbits 环形最长回文子序列
Two Rabbits---------------------------------------------------------------------模型可以转化为求长度为n的序列的最长回文子序列方法为枚举起点+记忆化+环形dp用next(i)代替i++,prev(i)代替i--f[i][j]表示环(i,j)的最长回文子序列。若i=j则环区间为空,若i>j原创 2013-09-16 10:37:55 · 786 阅读 · 0 评论 -
【专题】单调队列/斜率优化DP
一、单调队列二、单调队列dp三、斜率优化四、BST解决不单调的dp问题原创 2013-07-25 11:04:00 · 849 阅读 · 0 评论 -
【专题】Subsequence
回文子序列----------------------------环形回文子序列HDU 4745 Two Rabbits----------------------------重点是用next() prev() 代替l+1,r-1----------------------------const int maxn=1111;int a[maxn];原创 2013-09-17 21:42:54 · 860 阅读 · 0 评论 -
SGU 104 Little shop of flowers 经典DP
104. Little shop of flowerstime limit per test: 0.5 sec. memory limit per test: 4096 KBPROBLEMYou want to arrange the window of your flower shop in a most pleasant way. You have F bunc原创 2013-10-13 18:19:23 · 861 阅读 · 0 评论 -
UVA 10635 Prince and Princess DP LIS
--------int n;int a1[111111];int a2[111111];int c[111111];int a[111111];int g[111111];int d[111111];int N,p,q;int main(){ int T; scanf("%d",&T); for (int cas=1;cas<=T;cas++)原创 2014-01-10 00:26:36 · 715 阅读 · 0 评论 -
URAL 1039 Anniversary Party 树形dp
-----------const int maxn=10000;const int maxm=110000;int n;struct EdgeNode{ int to,next;}edges[maxm];int head[maxn],edge;void init(){ memset(head,-1,sizeof(head)); edge=0;}void原创 2014-01-12 18:37:33 · 645 阅读 · 0 评论 -
ZOJ 3149 Breadtree DP
--------------------const int maxn=100000;const int maxm=10000;const LL LIM=1234567890LL;LL n,k;LL f[maxn];LL sum[maxn];int main(){ while (cin>>n>>k){ if (n==0) break; if (原创 2014-01-12 22:30:01 · 638 阅读 · 0 评论 -
数位dp 学习指南
经典题目原创 2014-07-24 16:54:40 · 1385 阅读 · 0 评论 -
hdu 4722 Good Numbers 数位dp
Good NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 602 Accepted Submission(s): 220Problem DescriptionIf we sum up ev原创 2013-09-12 15:58:36 · 877 阅读 · 0 评论 -
poj 1769 Minimizing maximizer 线段树优化的dp
Minimizing maximizerTime Limit: 5000MS Memory Limit: 30000KTotal Submissions: 3047 Accepted: 1187DescriptionThe company Chris Ltd. is preparing a new sorting ha原创 2013-09-03 21:27:41 · 1413 阅读 · 0 评论 -
Uva 1366 - Martian Mining dp
The NASA Space Center, Houston, is less than 200 miles from San Antonio, Texas (the site of the ACM Finals this year). This is the place where the astronauts are trained for Mission Seven Dwarfs, the原创 2013-06-04 15:26:36 · 947 阅读 · 0 评论 -
UVa 1330 - City Game 最大子矩阵
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees, factories and buildin原创 2013-06-15 10:59:25 · 880 阅读 · 0 评论 -
UVa 10755 - Garbage Heap 最大子块和 dp
Garbage HeapTime limit: ? secondsMemory limit: 64 megabytesFarmer John has a heap of garbage formed in a rectangular parallelepiped.It consists of garbage pieces each of which has a value.原创 2013-06-06 14:47:15 · 1146 阅读 · 0 评论 -
MUTC 3 D - Cut the cake 最大子矩阵
Cut the cakeTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 835 Accepted Submission(s): 308Problem DescriptionMark bought a h原创 2013-06-15 11:51:09 · 1096 阅读 · 0 评论 -
扫描线法求最大子矩阵
问题描述:给定一个N*M的矩阵,其中有一些格子是空地,其他是障碍。找出一个全部由空地组成的面积/周长最大的子矩阵。朴素算法:枚举左上角的坐标O(mn)和右下角的坐标O(mn),判断是否全为空地O(mn),时间复杂度为O(m3*n3)。扫描线法:把点(i,j)向上所有连续的空格看做一条悬线。矩阵中的每个点都向上对应了一条悬线。①用h[i,j]表示点原创 2013-06-15 09:58:51 · 1607 阅读 · 1 评论 -
MUTC7 C - Dragon Ball 单调队列dp
Dragon BallTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1680 Accepted Submission(s): 614Problem DescriptionSean has got a原创 2013-07-24 11:52:29 · 897 阅读 · 0 评论