
ACM_DP
文章平均质量分 73
**:天下第一
这个作者很懒,什么都没留下…
展开
-
acm动态规划中新数据对原始数据的干扰和排除
以下面的这道题为例。。有一个箱子容量为V(正整数,0<=V<=20000),同时有n个物品(0<n<=30),每个物品有一个体积(正整数)。要求n个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。输入描述 Input Description一个整数v,表示箱子容量一个整数n,表示有n个物品接下来n个整数,分别表示这n 个物原创 2014-07-26 15:40:07 · 781 阅读 · 0 评论 -
差点就发现了完全背包。。
突然发现我上上次的博文,,,讲的就是完全背包啊。。。DP[]原创 2014-07-29 09:31:17 · 518 阅读 · 0 评论 -
嵌套矩阵+拓扑排序+循环
#include #include #include #include using namespace std;int T,m;bool smallest[32];bool biggest[32];int s[32][32];bool map[32][32];int f[32];int begain;int deg[32];int result[32];int deg_原创 2014-07-30 22:49:47 · 628 阅读 · 0 评论 -
数塔型的DP+输出字典序最小路经
#include #include int a[12][102];int f[12][102];int path[12][102];int record;int m,n;int cor;int min(int x,int y){ return x>y?y:x;}void print(int i,int j){ if(j>0) { print(path[i][j],原创 2014-07-31 16:48:13 · 591 阅读 · 0 评论 -
动态规划中的并行优化
原创 2014-08-11 16:14:19 · 1191 阅读 · 0 评论 -
动态规划中的并行优化
动态规划中的并行优化原创 2014-08-11 16:21:20 · 898 阅读 · 0 评论 -
【POJ3810】Magina
MaginaTime Limit: 60000/30000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 545 Accepted Submission(s): 178Problem DescriptionMagina, also known as A原创 2015-02-24 20:43:05 · 694 阅读 · 0 评论 -
【POJ2176】Pebbles
PebblesTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1222 Accepted Submission(s): 706Problem DescriptionYou're given an unlimit原创 2015-02-24 23:26:27 · 514 阅读 · 0 评论 -
【POJ3254】Corn Fields
Corn FieldsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8670 Accepted: 4622DescriptionFarmer John has purchased a lush new rectangular pasture compos原创 2015-02-25 11:18:47 · 397 阅读 · 0 评论 -
【POJ3311】Hie with the Pie(状态压缩DP)
Hie with the PieTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5031 Accepted: 2678DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to原创 2015-02-25 19:46:09 · 506 阅读 · 0 评论 -
【POJ1185】炮兵阵地
炮兵阵地Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 20433 Accepted: 7917Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原创 2015-02-25 15:31:47 · 636 阅读 · 0 评论 -
【POJ3211】Washing Clothes
Washing ClothesTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 8867 Accepted: 2809DescriptionDearboy was so busy recently that now he has piles of clot原创 2015-02-24 15:44:39 · 540 阅读 · 0 评论 -
【POJ3264】 Charm Bracelet
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from theN (1 ≤ N ≤ 3,402) available charms.原创 2015-02-12 20:34:36 · 463 阅读 · 0 评论 -
【HDU2546】饭卡
【科普】什么是BestCoder?如何参加?饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13530 Accepted Submission(s): 4696Problem Descr原创 2015-02-12 20:48:48 · 674 阅读 · 0 评论 -
【HDU3535】AreYouBusy
AreYouBusyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3242 Accepted Submission(s): 1248Problem DescriptionHappy New Term!As原创 2015-02-24 18:05:06 · 551 阅读 · 0 评论 -
【POJ2392】Space Elevator
这道题要按照ai排序。最优解可能在delta ai,ai-1 中放了块东西。如果先放ai大的可能使得ai小的并且存在在最优解中的那块没放进去。比如 1*4 5*6 如果先放5的话,此时5 》 4 。所以不能放1了。 ans = 5但是实际上如果先放1的话,此时1 《 6,依然可以放下5,此时可以放下5. ans = 6所以看起来不能用动态规划来做。。。但是实际上最优原创 2015-02-24 12:19:16 · 549 阅读 · 0 评论 -
【POJ2184】Cow Exhibition
Cow ExhibitionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9612 Accepted: 3715Description"Fat and docile, big and dumb, they look so stupid, they aren'原创 2015-02-13 12:32:21 · 444 阅读 · 0 评论 -
【HDU2639】Bone Collector II
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2667 Accepted Submission(s): 1394Problem DescriptionThe title of原创 2015-02-13 13:30:22 · 391 阅读 · 0 评论 -
【精华】【HDU3466】Proud Merchants
Proud MerchantsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3018 Accepted Submission(s): 1247Problem DescriptionRecently, iSe原创 2015-02-13 16:43:12 · 481 阅读 · 0 评论 -
【POJ】 【3624】
Charm BraceletTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26525 Accepted: 11925DescriptionBessie has gone to the mall's jewelry store and spies a ch原创 2015-07-12 10:40:51 · 416 阅读 · 0 评论 -
【ACM】【括号匹配】
括号匹配(二)时间限制:1000 ms | 内存限制:65535 KB难度:6描述给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起来。如:[]是匹配的([])[]是匹配的((]是不匹配的([)]是不匹配的输入第一行输入一个正整数N,表示测试数据组数(N每组测试数原创 2015-07-11 21:59:01 · 1290 阅读 · 0 评论 -
【SPOJ】【Mixtures】
D - MixturesTime Limit:3000MS Memory Limit:1572864KB 64bit IO Format:%lld & %lluSubmit Status Practice SPOJ MIXTURESDescriptionHarry Potter has n mixtures in front of h原创 2015-07-12 21:50:15 · 453 阅读 · 0 评论 -
【UVA】【10328】
总结 变量名addToss is an important part of any event. When everything becomes equal toss is the ultimate decider.Normally a fair coin is used for Toss. A coin has two sides head(H) and tail(T). Superst转载 2015-07-13 22:15:03 · 404 阅读 · 0 评论 -
【zoj】【Attack on Titans】
Attack on TitansTime Limit: 2 Seconds Memory Limit: 65536 KBOver centuries ago, mankind faced a new enemy, the Titans. The difference of power between mankind and their newfound enemy w原创 2015-07-13 18:24:00 · 493 阅读 · 0 评论 -
【HDU4632】【Palindrome subsequence】
Palindrome subsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65535 K (Java/Others)Total Submission(s): 2641 Accepted Submission(s): 1065Problem DescriptionIn原创 2015-08-05 00:07:21 · 487 阅读 · 0 评论 -
【HDU2476】【String painter】
String painterTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2368 Accepted Submission(s): 1038Problem DescriptionThere are t原创 2015-08-05 00:07:42 · 831 阅读 · 0 评论 -
【CF245H】【Queries for Number of Palindromes】
H. Queries for Number of Palindromestime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got a string s原创 2015-08-07 19:25:53 · 711 阅读 · 0 评论 -
【POJ3280】【Cheapest Palindrome】
Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6919 Accepted: 3354DescriptionKeeping track of all the cows can be a tricky task so F原创 2015-08-08 15:59:04 · 415 阅读 · 0 评论 -
【java】【第二章】【变量】
1. 变量 1.1 引用存在栈中,对象存在堆中1.2 类的成员函数在堆中,然后初始化为0。2.基本类型 2.1 存在栈中 直接存储值原创 2015-07-15 09:23:40 · 360 阅读 · 0 评论 -
【HDU】【The King’s Ups and Downs】
The King’s Ups and DownsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 366 Accepted Submission(s): 245Problem DescriptionThe原创 2015-07-14 20:14:23 · 709 阅读 · 0 评论 -
【HDU】【Number String】
Number StringTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1560 Accepted Submission(s): 699Problem DescriptionThe signatur原创 2015-07-14 22:04:34 · 750 阅读 · 0 评论 -
【HDU4570】【Multi-bit Trie】
Multi-bit TrieTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 543 Accepted Submission(s): 217Problem Description IP lookup i转载 2015-08-08 14:43:42 · 522 阅读 · 0 评论 -
【CF149D】【Coloring Brackets】
D. Coloring Bracketstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce Petya read a problem about a brac转载 2015-08-07 22:16:57 · 385 阅读 · 0 评论 -
【背包总结】【交换维度】
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int n,tot;const int N = 10;const int M = 1000;int d原创 2015-08-03 23:06:22 · 278 阅读 · 0 评论 -
【HDU2196】【Computer】
ComputerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4386 Accepted Submission(s): 2207Problem DescriptionA school bought t原创 2015-08-09 19:29:57 · 385 阅读 · 0 评论 -
【HDU1520】【Anniversary party】
Anniversary partyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6633 Accepted Submission(s): 2953Problem DescriptionThere is原创 2015-08-04 20:28:26 · 513 阅读 · 0 评论 -
【hdu】【Robberies】
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16086 Accepted Submission(s): 5890Problem DescriptionThe aspiring Ro原创 2015-07-29 10:19:40 · 336 阅读 · 0 评论 -
【HDU2089】【不要62】
不要62Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25749 Accepted Submission(s): 8954Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:原创 2015-08-09 21:58:42 · 460 阅读 · 0 评论 -
【HDU35350】【Bomb】
BombTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 10630 Accepted Submission(s): 3753Problem DescriptionThe counter-terrori原创 2015-08-10 11:42:36 · 410 阅读 · 0 评论 -
【POJ2923】【Relocation】
RelocationTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2651 Accepted: 1080DescriptionEmma and Eric are moving to their new house they bought after原创 2015-07-29 17:03:27 · 422 阅读 · 0 评论