动态规划
文章平均质量分 82
cmonkey
追随大自然的召唤
展开
-
POJ 3252 Round Number
Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5077 Accepted: 1736DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scisso原创 2012-02-03 22:39:44 · 1413 阅读 · 0 评论 -
BUPT 199 Beat it!
BUPT 199 Beat it!DescriptionThere's a monster-attacking game on the Renren's open platform, and the game's background are showing below.Where lies a strange country, lices a strange monster.原创 2011-07-27 09:22:45 · 611 阅读 · 0 评论 -
HDU 3709 Balanced Number
Balanced NumberTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 162 Accepted Submission(s): 59Problem DescriptionA balanced number is a原创 2011-08-05 15:51:01 · 2197 阅读 · 2 评论 -
HDU 3652 B-number
题意:1..n的数中数字包含‘13’且能被13整除的,有多少个。n分析:按位DP困在能被13整除上了,查了能被13整除的数的特性,不知道怎么转化dp...后来看了解题报告,状态上多记录个模13的余数就好了~#include #include #include int ans;int num[10], ln;int f[10][13][3];void原创 2011-08-07 16:52:53 · 1021 阅读 · 0 评论 -
HDU 3913 Suffix
SUFFIXTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 85 Accepted Submission(s): 27Problem DescriptionA string is a list of characters原创 2011-08-10 15:19:20 · 962 阅读 · 0 评论 -
BUPT 202 chocolate mashine
北邮多校联合赛HBUPT 202 chocolate mashine[Description]There is a Vending machine sales which sell magic chocolate in Renren office. The chocolate is shaped like a n*m rectangle, andeach 1*1 unit is as原创 2011-07-27 09:14:13 · 574 阅读 · 0 评论 -
HDU 3828 A+B problem
Problem DescriptionQQ and OO always play the game of A + B. QQ gives tow decimal number A and B, and OO answers the sum at once. But to do the same things too often is boring. So, today they are fed原创 2011-07-27 10:04:53 · 1066 阅读 · 0 评论 -
HDU 3831 DICS
Problem DescriptionThis time, we are involved in a more complicated one: given two strings SOURCE and DESTINATION , we have 4 operationsDelete: remove the ith character.Insert: in pos i(the ith原创 2011-07-27 09:48:10 · 983 阅读 · 0 评论 -
HDU 3872 Dragon Ball
Dragon BallTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65768/32768 K (Java/Others)Total Submission(s): 113 Accepted Submission(s): 45Problem DescriptionThere are N "dragon balls"原创 2011-08-02 09:19:58 · 954 阅读 · 0 评论 -
HDU 3920 Clear all of them I
Clear All of Them ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 122768/62768 K (Java/Others)Total Submission(s): 722 Accepted Submission(s): 217Problem DescriptionAcmers have been原创 2011-08-12 15:52:16 · 691 阅读 · 0 评论 -
POJ 1671 Rhyme Schemes
Rhyme SchemesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1175 Accepted: 645 Special JudgeDescriptionThe rhyme scheme for a poem (or stanza o原创 2012-03-06 13:55:25 · 1238 阅读 · 0 评论 -
小记
1.LIS有1...n这n个数的排列,一次移动可以把任一数放任一位置,问至少多少次移动,使成1...n的递增顺序答案说n-LIS将LIS外的数,移到LIS中合适的位置,一定为使LIS+1因为移完,那个数的位置有三种可能1.在LIS某两数之间,LIS+12.在LIS之前,或之后,LIS+13.与LIS某数位置重合,LIS不变;因为此处数不相同,所有不会重合。所有L原创 2012-03-03 16:24:25 · 425 阅读 · 0 评论 -
POJ 1742 Coins
CoinsTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 21637 Accepted: 7358DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3原创 2012-02-27 12:36:41 · 653 阅读 · 1 评论 -
POJ 1015 Jury Compromise
Jury CompromiseTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19548 Accepted: 4886 Special JudgeDescriptionIn Frobnia, a far-away country, the ve原创 2012-02-13 13:59:00 · 670 阅读 · 0 评论 -
POJ 1037 A decorative fence
A decorative fenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5280 Accepted: 1880DescriptionRichard just finished building his new house. Now the原创 2012-02-13 13:57:48 · 973 阅读 · 0 评论 -
POJ 1636 Prison rearrangement
Prison rearrangementTime Limit: 3000MS Memory Limit: 10000KTotal Submissions: 1447 Accepted: 693DescriptionIn order to lower the risk of riots and escape atte原创 2012-02-14 20:29:27 · 770 阅读 · 0 评论 -
POJ 1848 Tree
TreeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 2564 Accepted: 859DescriptionConsider a tree with N vertices, numbered from 1 to N. Add, if it is原创 2012-02-14 18:53:33 · 572 阅读 · 0 评论 -
POJ 1742 Coins
CoinsTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 21551 Accepted: 7343DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3..原创 2012-02-16 23:58:16 · 555 阅读 · 0 评论 -
POJ 1947 Rebuilding Roads
Rebuilding RoadsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6309 Accepted: 2724DescriptionThe cows have reconstructed Farmer John's farm, with its原创 2012-02-16 14:52:23 · 716 阅读 · 0 评论 -
HDU 1171 Big Event in HDU
Big Event in HDUTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10355 Accepted Submission(s): 3595Problem DescriptionNowaday原创 2012-02-27 12:35:08 · 425 阅读 · 0 评论 -
背包优化
多重背包优化一•看做有N组物品,放入容量为j的背包,对于每组物品,选择放入的数量k(0…n[i])•对于第i种物品,放入容量为j的背包f[j+k*c[i]] = max{f[j+k*c[i]],f[j]+k*w[i]}•j= 0: c[i], 2*c[i], 3*c[i],..., n[i]*c[i]•j= 1: 1+c[i], 1+2*c[i]...•j= c[i原创 2012-02-27 12:29:39 · 607 阅读 · 0 评论 -
HDU 3732 Ahui Writes Word
Ahui Writes WordTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 701 Accepted Submission(s): 283Problem DescriptionWe all know原创 2012-02-27 12:32:31 · 607 阅读 · 0 评论 -
POJ 2430 Lazy Cows
Lazy CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1897 Accepted: 718DescriptionFarmer John regrets having applied high-grade fertilizer to hi原创 2012-02-19 19:19:52 · 1329 阅读 · 0 评论 -
codeforce 55D Beautiful numbers
D. Beautiful numberstime limit per test:4 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputVolodya is an odd boy and his taste is strange as well. It see原创 2011-08-07 23:00:38 · 2078 阅读 · 5 评论