DP
hncu__lz
既然坚持了这么久,就要坚持到最后~
展开
-
poj 1463 Strategic game (树形DP)
DescriptionBob 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 d原创 2016-08-29 22:00:36 · 363 阅读 · 0 评论 -
hdu 3652 B-number (数位DP)
Problem DescriptionA wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers原创 2016-09-17 18:57:13 · 227 阅读 · 0 评论 -
hdu 4507 吉哥系列故事——恨7不成妻(数位DP)
Problem Description 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数原创 2016-09-22 19:48:29 · 395 阅读 · 0 评论 -
poj 3311 Hie with the Pie (弗洛伊德+状态压缩)
DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries原创 2016-10-09 20:27:21 · 255 阅读 · 0 评论 -
poj 2096 Collecting Bugs (概率DP)
Collecting Bugs Time Limit: 10000MS Memory Limit: 64000K Total Submissions: 4955 Accepted: 2461 Case Time Limit: 2000MS Special Judge DescriptionIvan is fond of collecting. Unlike other原创 2016-09-22 21:58:29 · 171 阅读 · 0 评论 -
poj 3254 Corn Fields (状态DP)
DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares原创 2016-09-23 22:54:31 · 157 阅读 · 0 评论 -
hdu 2089 不要62 (数位DP)
Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和原创 2016-09-08 18:17:20 · 241 阅读 · 0 评论 -
hdu 4734 F(x) 数位DP
Problem DescriptionFor a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 * 1. Now you are given two numbers A and B原创 2016-09-21 19:43:02 · 275 阅读 · 0 评论 -
hdu 4352 XHXJ's LIS (数位+状态DP)
Problem Description#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important.As the strongest fighting force in UESTC, xh原创 2016-09-21 21:39:40 · 232 阅读 · 0 评论 -
hdu 3709 Balanced Number (数位DP)
Problem Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the dig原创 2016-09-22 10:56:32 · 191 阅读 · 0 评论 -
poj 3252 Round Numbers (数位DP)
DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) i原创 2016-09-22 12:50:32 · 154 阅读 · 0 评论 -
hdu 1565 方格取数(1) (状态压缩DP)
Problem Description给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n Output对于每个测试实例,输出可能取得的原创 2016-10-23 21:52:22 · 218 阅读 · 0 评论 -
hdu 4501 (小明系列故事——买年货) (多维背包)
Problem Description 春节将至,小明要去超市购置年货,于是小明去了自己经常去的都尚超市。 刚到超市,小明就发现超市门口聚集一堆人。用白云女士的话说就是:“那家伙,那场面,真是人山人海,锣鼓喧天,鞭炮齐呤,红旗招展。那可真是相当的壮观啊!”。好奇的小明走过去,奋力挤过人群,发现超市门口贴了一张通知,内容如下: 值此新春佳节来临之际,为了回馈广大顾客的支持和原创 2016-11-05 20:51:14 · 278 阅读 · 0 评论 -
hdu 4502 (吉哥系列故事——临时工计划)(贪心+背包)
Problem Description 俗话说一分钱难倒英雄汉,高中几年下来,吉哥已经深深明白了这个道理,因此,新年开始存储一年的个人资金已经成了习惯,不过自从大学之后他不好意思再向大人要压岁钱了,只能把唯一的希望放到自己身上。可是由于时间段的特殊性和自己能力的因素,只能找到些零零碎碎的工作,吉哥想知道怎么安排自己的假期才能获得最多的工资。 已知吉哥一共有m天的假期,每天的编号从1到m原创 2016-11-05 21:40:14 · 436 阅读 · 0 评论 -
poj 1185 炮兵阵地 (压缩状态DP)
Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的原创 2016-10-25 19:50:36 · 252 阅读 · 0 评论 -
poj 2411 Mondriaan's Dream(状态压缩DP)
DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw o原创 2016-10-25 21:47:56 · 198 阅读 · 0 评论 -
hdu 4504 威威猫系列故事——篮球梦 (递推)
Problem Description 威威猫十分迷恋篮球比赛,是忠实的NBA球迷,他常常幻想自己那肥硕的身躯也能飞起扣篮。另外,他对篮球教练工作也情有独钟,特别是对比赛的战术,投篮选择方面也是很有研究,下面就是威威猫研究过的一个问题: 一场NBA篮球比赛总共48分钟,假如我们现在已经知道当前比分 A:B,A代表我方的比分,B代表对方的比分,现在比赛还剩下t秒时间。我们简单的认为双方各原创 2016-11-06 14:58:46 · 535 阅读 · 0 评论 -
poj1651 Multiplication Puzzle(区间DP)
DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal原创 2016-08-14 12:07:24 · 177 阅读 · 0 评论 -
HDU1028(DP)
转自http://blog.csdn.net/ice_crazy/article/details/7478802 本题的意思是:整数划分问题是将一个正整数n拆成一组数连加并等于n的形式,且这组数中的最大加数不大于n。 如6的整数划分为65 + 14 + 2, 4 + 1 + 13 + 3, 3 + 2 + 1, 3 + 1 + 1 + 12 + 2 + 2, 2 + 2 + 1原创 2016-04-15 16:43:12 · 201 阅读 · 0 评论 -
poj 2342 Anniversary party (树形DP)
DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation原创 2016-08-18 15:28:39 · 199 阅读 · 0 评论 -
poj 2955 Brackets (区间DP)
DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s] are regu原创 2016-08-09 08:54:11 · 156 阅读 · 0 评论 -
hdu 1947 Rebuilding Roads(树形DP)
DescriptionThe cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn't have time to rebuild any extra road原创 2016-08-30 22:49:28 · 256 阅读 · 0 评论 -
hdu 4570 Multi-bit Trie (区间DP)
Problem Description IP lookup is one of the key functions of routers for packets forwarding and classifying. Generally, IP lookup can be simplified as a Longest Prefix Matching (LPM) problem. That’s原创 2016-08-09 18:00:05 · 224 阅读 · 0 评论 -
hdu2476 String painter (区间DP)
Problem Description There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can chang原创 2016-08-10 08:46:04 · 318 阅读 · 0 评论 -
poj 3280 Cheapest Palindrome(区间DP)
DescriptionKeeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the co原创 2016-08-10 11:25:56 · 212 阅读 · 0 评论 -
hdu 1561 The more, The Better(树形DP)
Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input每个测试实例首先包括2个整数,N,M.(原创 2016-08-31 22:30:16 · 166 阅读 · 0 评论 -
poj 2282 The Counting Problem (数位DP)
DescriptionGiven two integers a and b, we write the numbers between a and b, inclusive, in a list. Your task is to calculate the number of occurrences of each digit. For example, if a = 1024 and b原创 2016-09-12 23:20:08 · 393 阅读 · 0 评论 -
hdu 3555 Bomb(数位DP)
Problem DescriptionThe counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curren原创 2016-09-13 14:16:43 · 318 阅读 · 0 评论 -
poj3286 How many 0's? (数位DP)
DescriptionA Benedict monk No.16 writes down the decimal representations of all natural numbers between and including m and n, m ≤ n. How many 0's will he write down?InputInput consists of原创 2016-09-13 19:27:41 · 273 阅读 · 0 评论 -
hdu 4283 You Are the One(区间DP)
Problem Description The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The show is hold in the Small hall,原创 2016-08-12 02:43:04 · 661 阅读 · 0 评论 -
hdu 4632 Palindrome subsequence (区间DP+容斥)
Problem Description In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, t原创 2016-08-12 05:11:51 · 228 阅读 · 0 评论 -
hdu 2196 Computer (树形DP)
Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one o原创 2016-09-02 20:58:29 · 196 阅读 · 0 评论 -
poj 3056 The Bavarian Beer Party (区间DP)
DescriptionThe professors of the Bayerische Mathematiker Verein have their annual party in the local Biergarten. They are sitting at a round table each with his own pint of beer. As a ceremony each pro原创 2016-08-12 11:37:07 · 302 阅读 · 0 评论 -
poj 3186 Treats for the Cows (区间DP)
DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a giv原创 2016-08-12 13:58:02 · 327 阅读 · 0 评论 -
hdu5045(压缩状态DP)
Problem Description In the ACM International Collegiate Programming Contest, each team consist of three students. And the teams are given 5 hours to solve between 8 and 12 programming problems. On Mar原创 2016-06-08 20:53:18 · 366 阅读 · 0 评论 -
hdu2167(压缩DP)
Problem Description You’re given an unlimited number of pebbles to distribute across an N x N game board (N drawn from [3, 15]), where each square on the board contains some positive point value betwe原创 2016-06-05 19:50:41 · 479 阅读 · 0 评论 -
hdu 3920 Clear All of Them I (状态压缩DP)
Problem DescriptionAcmers have been the Earth Protector against the evil enemy for a long time, now it’s your turn to protect our home. There are 2 * n enemies in the map. Your task is to clear a原创 2016-10-27 22:01:55 · 238 阅读 · 0 评论