
dp
文章平均质量分 83
akxxsb
写写博客装装逼,存代码
展开
-
hdu 2571
命运Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2013-05-30)Description穿过幽谷意味着离大魔王lemon已经无限接近了!原创 2014-04-20 19:46:03 · 783 阅读 · 0 评论 -
Codeforces Round #235 (Div. 2) D. Roman and Numbers(状压dp)
Roman and Numberstime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputRoman is a young mathematician, very famo原创 2014-12-19 01:36:15 · 1302 阅读 · 0 评论 -
POJ 1018(dp Or 枚举)
Communication SystemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23738 Accepted: 8437DescriptionWe have received an order from Pizoor Communications原创 2014-12-31 22:14:32 · 1182 阅读 · 0 评论 -
哈理工2249开锁魔法 概率dp
开锁魔法IITime Limit: 3000 MSMemory Limit: 256000 KTotal Submit: 23(18 users)Total Accepted: 18(16 users)Rating: Special Judge: NoDescription一日,原创 2015-04-11 22:53:49 · 918 阅读 · 0 评论 -
NEUOJ 1484概率dp
1484: Hengheng eat noodles时间限制: 1 Sec 内存限制: 256 MB提交: 20 解决: 17[提交][状态][讨论版]题目描述As we all know,Hengheng(big cow),very look forward to meizi and he often declare that he want to find原创 2015-04-11 22:15:14 · 968 阅读 · 0 评论 -
Codeforces Round #302 (Div. 2)C (完全背包)
C. Writing Codetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProgrammers working on a large project have原创 2015-05-08 03:15:44 · 1089 阅读 · 0 评论 -
POJ 1742(特别技巧之多重背包转完全背包)
DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e.,原创 2014-04-15 19:46:57 · 1135 阅读 · 0 评论 -
Codeforces Round #302 (Div. 2) E. Remembering Strings(状压dp)
E. Remembering Stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have multiset of n strings of th原创 2015-05-08 20:20:50 · 1394 阅读 · 0 评论 -
UVA 1640(数位统计)
The Counting ProblemTime Limit:3000MS Memory Limit:Unknown 64bit IO Format:%lld & %lluSubmitStatusDescriptionGiven two integers a and b, we write the numbers原创 2015-05-01 16:05:17 · 1141 阅读 · 0 评论 -
Codeforces Round #301 (Div. 2)D (概率dp)
D. Bad Luck Islandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Bad Luck Island is inhabited by thre原创 2015-05-06 13:24:12 · 780 阅读 · 0 评论 -
UVA 12063(dp记忆化)
UVA - 12063Zeros and OnesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionBinary numbers and their pattern o原创 2015-05-07 01:07:49 · 1819 阅读 · 0 评论 -
UVA1213 Sum of Different Primes(素数打表+dp)
UVA - 1213Sum of Different PrimesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionA positive integer may be ex原创 2015-05-07 01:18:55 · 1485 阅读 · 0 评论 -
UVA 1645(dp)
输入n,统计有多少个n节点的有根树。使得每个深度中所有节点的子节点数相同。可以根据节点的孩子个数dp。开始写了个记忆化,dp[n][p]表示n个节点,第一个节点有p个孩子的方案数#includeusing namespace std;typedef long long ll;const int maxn = 1000 + 5;const ll mod = 1e9 + 7;原创 2015-05-07 15:40:25 · 631 阅读 · 0 评论 -
poj 1655Balancing Act(找重心,树形dp)
Balancing ActTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10375 Accepted: 4296DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1原创 2015-06-21 19:38:25 · 944 阅读 · 0 评论 -
HDU 5273(递推)
Dylans loves sequence Accepts: 250 Submissions: 806 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)问题描述Dylans得到了N个数a[1]...a[N]。有Q个问题,每个原创 2015-06-22 01:54:51 · 1214 阅读 · 0 评论 -
UVA 1638(动态规划)
有高为1到n的杆子各一根排成一行,从左往右能看见l根,从右往左能看见r根,问可能的方案数。dp[i][j][k]表示i根高度不同的杆子从左往右能看见j根,从右往左能看见k根,根据高度最低的那根杆子分类。#include #include #include #include using namespace std;typedef long long ll;const in原创 2015-05-08 21:32:23 · 1067 阅读 · 0 评论 -
Codeforces Round #336 (Div. 2) D. Zuma(区间dp)
D. Zumatime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputGenos recently installed the game Zuma on his phone原创 2016-01-22 16:13:10 · 1054 阅读 · 2 评论 -
hdu5593 树形dp
ZYB's Tree Accepts: 77 Submissions: 513 Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)问题描述ZYBZYB有一颗NN个节点的树,现在他希望你对于每一个点,求出离每个点距离不超过KK的点原创 2015-12-06 01:07:08 · 766 阅读 · 0 评论 -
概率dp+状态压缩HDU4336
Card CollectorTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4336Appoint description: System Crawler (2014-10-23)Descript原创 2014-10-25 21:53:09 · 896 阅读 · 0 评论 -
概率dp HDU 4405
Aeroplane chessTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4405Appoint description: System Crawler (2014-10-18)Descrip原创 2014-10-25 21:43:24 · 890 阅读 · 0 评论 -
hdu 2602(01背包裸题)
Bone CollectorTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-03)DescriptionMany years ago原创 2014-04-20 20:05:14 · 1012 阅读 · 0 评论 -
poj1163(数字三角形)
The TriangleTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-14)Description73 88原创 2014-04-20 19:38:13 · 1107 阅读 · 0 评论 -
NEUOJ 1302: 最大子序列(双向dp)
第一次写dp,有点小激动哈哈,纪念下1302: 最大子序列时间限制: 1 Sec 内存限制: 128 MB提交: 174 解决: 41[提交][状态][讨论版]题目描述给定一个N个整数组成的序列,整数有正有负,找出两段不重叠的连续子序列,使得它们中整数的和最大。两段子序列都可以为空。输入多组输入,每组第一行为N原创 2014-04-04 20:04:01 · 1323 阅读 · 0 评论 -
hdu 2955
转成以所有银行的总资产为背包容量V。。求最大的逃跑概率。原创 2014-04-20 20:14:37 · 742 阅读 · 0 评论 -
hdu 1203(01背包)
NEED A OFFER!Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-03)DescriptionSpeakless很早就想出原创 2014-04-20 20:09:35 · 918 阅读 · 0 评论 -
hdu 1003(最大连续子序列和)
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 132525 Accepted Submission(s): 30717Problem DescriptionGiven a sequenc原创 2014-04-06 00:43:08 · 1297 阅读 · 0 评论 -
poj 1088
滑雪Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-04-20)DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪原创 2014-04-20 19:52:03 · 853 阅读 · 0 评论 -
hdu 1114(完全背包裸题)
Piggy-BankTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusAppoint description: System Crawler (2014-03-08)DescriptionBefore ACM can do原创 2014-04-20 19:57:20 · 803 阅读 · 0 评论 -
UVA 103
Stacking Boxes BackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbitrary dimensions. Co原创 2014-04-21 17:04:50 · 889 阅读 · 0 评论 -
UVA 674完全背包
#include #include#include#define INF 0X7ffffffftypedef long long LL;LL dp[8000];int sum=0;int main(){ //freopen("input.txt","r",stdin); int n; while(~scanf("%d",&n)) { i原创 2014-04-21 17:12:36 · 984 阅读 · 0 评论 -
UVA 111
和最长公共子序列差不多的dpA - History GradingTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 111Appoint description: System Crawler (2014-03原创 2014-04-21 17:00:24 · 945 阅读 · 0 评论 -
石子合并(区间dp)
石子合并(一)时间限制:1000 ms | 内存限制:65535 KB难度:3描述 有N堆石子排成一排,每堆石子有一定的数量。现要将N堆石子并成为一堆。合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆。求出总的代价最小值。输入有多组测试数据,输入到文件结束。每组测试数据第一行有一个整原创 2014-05-10 00:22:30 · 964 阅读 · 0 评论 -
最长公共上升子序列(LCIS)ZOJ 2432
立方算法:#include#include#include#include#define M 505using namespace std;typedef long long LL;LL a[M],b[M];int dp[M][M];int main(){ //freopen("in.txt","r",stdin); int T; cin>>T;原创 2014-07-20 22:35:05 · 1337 阅读 · 1 评论 -
概率dp poj2096
Collecting BugsTime Limit: 10000MS Memory Limit: 64000KTotal Submissions: 2341 Accepted: 1126Case Time Limit: 2000MS Special JudgeDescriptionIvan is fon原创 2014-08-01 13:31:17 · 783 阅读 · 0 评论 -
概率dp ZOJ 3640
Help Me EscapeTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice ZOJ 3640Appoint description: System Crawler (2014-10-22)Descriptio原创 2014-10-25 21:45:42 · 959 阅读 · 0 评论 -
概率dp HDU 3853
H - LOOPSTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 3853Appoint description: System Crawler (2014-10-22)Description原创 2014-10-25 21:35:00 · 924 阅读 · 0 评论 -
概率dp sgu495
Kids and PrizesTime Limit:250MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice SGU 495Appoint description: System Crawler (2014-10-25)Descriptio原创 2014-10-25 21:23:05 · 1219 阅读 · 3 评论 -
Sort It (树状数组+dp)
主页讨论版问题名次状态统计请参赛队员将NickName修改为以下格式:队员1_队员2_队员3问题 F: Sort It时间限制: 6 Sec 内存限制: 128 MB提交: 30 解决: 8[提交][状态][讨论版]题目描述You are given a permutation of length n:p1,p2,原创 2016-02-19 13:56:18 · 825 阅读 · 0 评论