DP
13vickey
从不思考到底离梦的距离有多远,走一步注定会近一步,一步一步,用旅途的努力来收获成长。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Milking Time 简单DP
D - Milking TimeTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionBessie is such a hard-working cow. In fact, she is so focused on maximizing her p原创 2013-10-28 19:57:25 · 722 阅读 · 0 评论 -
UVA - 10534 Wavio Sequence LIS 二分+DP
题意就是找长度为 2*N +1 的序列,N+1是yang原创 2014-07-10 20:14:19 · 520 阅读 · 0 评论 -
poj 2662 A Walk Through the Forest
A Walk Through the ForestTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2385 Accepted: 880DescriptionJimmy experiences a lot of stress at work these days原创 2014-07-29 11:01:50 · 730 阅读 · 0 评论 -
hdu 4856 Tunnels 哈密顿通路
点击打开链接题意: 给了n*n 的地图,Mti原创 2014-07-11 14:30:53 · 590 阅读 · 0 评论 -
poj 2342 树状DP
dp[x][k] x为当前节点的标号; k=0 bu原创 2014-07-12 15:28:05 · 454 阅读 · 0 评论 -
poj 2411 Mondriaan's Dream
点击打开链接原创 2014-07-12 21:44:24 · 462 阅读 · 0 评论 -
UVALive - 2728 A Spy in the Metro DP
题目题意原创 2014-07-15 10:41:35 · 728 阅读 · 0 评论 -
UVA - 10910 Marks Distribution 简单DP
点击打开链接原创 2014-07-14 15:23:46 · 501 阅读 · 0 评论 -
poj 2663 压缩DP
#include#include#include#include#include#includeusing namespace std;long long dp[33][1<<4];int map[1<<4][1<<4];int n,m;void dfs(int x,int y,int dep){ if(dep==m){ map[x][y]=1;原创 2014-07-13 20:33:56 · 526 阅读 · 0 评论 -
B. Appleman and Tree 树状DP
B. Appleman and Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAppleman has a tree with n vertices. Some of the原创 2014-10-30 23:48:58 · 724 阅读 · 0 评论 -
炮兵阵地 压缩DP
炮兵阵地时间限制:2000 ms | 内存限制:65535 KB难度:6描述 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:原创 2014-11-17 15:07:33 · 495 阅读 · 0 评论 -
Sweet Child Makes Trouble 错排
Sweet Child Makes TroubleInput: standard inputOutput: standard outputTime Limit: 8 secondsChildren are always sweet but they can sometimes make you feel bitter. In this problem, you will see h原创 2014-11-18 20:16:44 · 1116 阅读 · 0 评论 -
Looking for Order 压缩DP
Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready for the University and noticed that the room was in a mess — all the objects from her handbag原创 2014-07-17 10:16:58 · 775 阅读 · 0 评论 -
poj 1141 括号匹配升级版 区间DP
http://poj.org/problem?id=1141用 pk[][]原创 2014-05-06 17:12:16 · 573 阅读 · 0 评论 -
邮票分你一半 N个数最大可能均分 01背包问题
邮票分你一半时间限制:1000 ms | 内存限制:65535 KB难度:3描述 小珂最近收集了些邮票,他想把其中的一些给他的好朋友小明。每张邮票上都有分值,他们想把这些邮票分成两份,并且使这两份邮票的分值和相差最小(就是小珂得到的邮票分值和与小明的差值最小),现在每张邮票的分值已经知道了,他们已经分好了,你知道最后他们得到的邮票分值和相差多少吗?输入第一行只有一原创 2014-04-04 20:38:06 · 730 阅读 · 0 评论 -
Longest Ordered Subsequence 最长上升子序列
Longest Ordered SubsequenceTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the sub原创 2013-10-29 22:42:29 · 734 阅读 · 0 评论 -
Cheapest Palindrome 简单dp
E - Cheapest PalindromeTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionKeeping track of all the cows can be a tricky task so Farmer John has inst原创 2013-10-29 21:23:48 · 586 阅读 · 0 评论 -
Apple Catching 简单DP
C - Apple CatchingTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionIt is a little known fact that cows love apples. Farmer John has two apple tree原创 2013-10-29 17:45:38 · 963 阅读 · 0 评论 -
hdu 1494 跑跑卡丁车 简单dp
跑跑卡丁车Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2115 Accepted Submission(s): 717Problem Description跑跑卡丁车是时下一款流行的网络休闲游戏,你可以在这原创 2014-03-01 19:35:01 · 914 阅读 · 0 评论 -
矩形嵌套 简单DP 最长上升子序列
矩形嵌套时间限制:3000 ms | 内存限制:65535 KB难度:4描述 有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于旋转X90度)。例如(1,5)可以嵌套在(6,2)内,但不能嵌套在(3,4)中。你的任务是选出尽可能多的矩形排成一行,使得除最后一个外,每一个矩形都可以嵌套在原创 2014-03-03 20:10:38 · 606 阅读 · 0 评论 -
dividing coins 简单dp
Input A line with the number of problems n, followed by n times:a line with a non negative integer m () indicating the number of coins in the baga line with m numbers separated by原创 2014-03-03 12:27:54 · 714 阅读 · 0 评论 -
The Triangle 简单DP
The Triangle时间限制:1000 ms | 内存限制:65535 KB难度:4描述 73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers原创 2014-03-03 21:43:01 · 653 阅读 · 0 评论 -
NYOJ 括号匹配(二) 区间DP
括号匹配(二)时间限制:1000 ms | 内存限制:65535 KB难度:6描述 给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起来。如:[]是匹配的([])[]是匹配的((]是不匹配的([)]是不匹配的输入第一行输入一个正整数N,表示测试数据组数(N每组测试数据都只有一行,是一个字原创 2014-03-03 21:28:09 · 636 阅读 · 0 评论 -
传纸条(一) DP
传纸条(一)难度:5描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题。一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了。幸运的是,他们可以通过传纸条来进行交流。纸条要经由许多同学传到对方手里,小渊坐在矩阵的左上角,坐标(1,1),小轩坐在矩阵的右下角,坐标(m,n)。从小渊传到小轩的纸条只可以向下或原创 2014-04-01 19:00:44 · 650 阅读 · 0 评论 -
POJ 3254 Corn Fields
题意:Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. some of the squares are infertile and can't be planted. (1 for fertile,原创 2014-01-27 12:20:05 · 1304 阅读 · 4 评论 -
最大和 NYOJ 简单三维DP
最大和时间限制:1000 ms | 内存限制:65535 KB难度:5描述 给定一个由整数组成二维矩阵(r*c),现在需要找出它的一个子矩阵,使得这个子矩阵内的所有元素之和最大,并把这个子矩阵称为最大子矩阵。 例子:0 -2 -7 0 9 2 -6 2 -4 1 -4 1 -1 8 0 -2 其最大子矩阵为:9 2 -4原创 2014-04-04 17:14:53 · 594 阅读 · 0 评论 -
hdu 5115 Dire Wolf 区间DP
Dire WolfTime Limit: 5000/5000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 86 Accepted Submission(s): 50Problem DescriptionDire wolves, also know原创 2014-11-30 14:41:56 · 573 阅读 · 0 评论
分享