随笔分类 -  DP

摘要:Fire Description Country Z has N cities, which are numbered from 1 to N. Cities are connected by highways, and there is exact one path between two dif 阅读全文
posted @ 2016-10-17 09:01 konjak魔芋 阅读(233) 评论(0) 推荐(0) 编辑
摘要:Apple Tree Description Wshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes in the tree. Each 阅读全文
posted @ 2016-10-15 11:08 konjak魔芋 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Magina Problem Description Magina, also known as Anti-Mage, is a very cool hero in DotA (Defense of the Ancient).If you have no idea of him, here is s 阅读全文
posted @ 2016-10-14 20:49 konjak魔芋 阅读(596) 评论(0) 推荐(0) 编辑
摘要:Tickets Description Conductor is quite a boring profession, as all you have to do is just to sell tickets to the passengers. So no wonder that once up 阅读全文
posted @ 2016-10-12 21:52 konjak魔芋 阅读(377) 评论(0) 推荐(1) 编辑
摘要:BIGSEQ - Sequence You are given the sequence of all K-digit binary numbers: 0, 1,..., 2K-1. You need to fully partition the sequence into M chunks. Ea 阅读全文
posted @ 2016-10-11 21:21 konjak魔芋 阅读(346) 评论(0) 推荐(0) 编辑
摘要:SORTBIT - Sorted bit squence no tags no tags Let's consider the 32 bit representation of all integers i from m up to n inclusive (m ≤ i ≤ n; m × n ≥ 0 阅读全文
posted @ 2016-10-10 20:57 konjak魔芋 阅读(301) 评论(0) 推荐(0) 编辑
摘要:Matches Puzzle Game Problem Description As an exciting puzzle game for kids and girlfriends, the Matches Puzzle Game asks the player to find the numbe 阅读全文
posted @ 2016-10-09 14:11 konjak魔芋 阅读(338) 评论(0) 推荐(0) 编辑
摘要:B-number Problem Description A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can b 阅读全文
posted @ 2016-10-08 21:24 konjak魔芋 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Balanced Number Problem Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specific 阅读全文
posted @ 2016-10-08 20:28 konjak魔芋 阅读(177) 评论(0) 推荐(0) 编辑
摘要:XHXJ's LIS Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2422 Accepted Submission(s): 990 Probl 阅读全文
posted @ 2016-10-08 16:56 konjak魔芋 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Tree Cutting Problem Description Byteasar has a tree T with n vertices conveniently labeled with 1,2,...,n. Each vertex of the tree has an integer val 阅读全文
posted @ 2016-10-07 12:50 konjak魔芋 阅读(1605) 评论(0) 推荐(0) 编辑
摘要:Tree Maker Problem Description Tree Lover loves trees crazily.One day he invents an interesting game which is named Tree Maker.In this game, all trees 阅读全文
posted @ 2016-09-21 22:08 konjak魔芋 阅读(479) 评论(0) 推荐(0) 编辑
摘要:http://www.cnblogs.com/ziyi--caolu/archive/2013/08/04/3236035.html 阅读全文
posted @ 2016-07-20 11:26 konjak魔芋 阅读(108) 评论(0) 推荐(0) 编辑
摘要:Apocalypse Someday Description The number 666 is considered to be the occult “number of the beast” and is a well used number in all major apocalypse t 阅读全文
posted @ 2016-07-17 10:00 konjak魔芋 阅读(261) 评论(0) 推荐(0) 编辑
摘要:3530: [Sdoi2014]数数 Description 我们称一个正整数N是幸运数,当且仅当它的十进制表示中不包含数字串集合S中任意一个元素作为其子串。例如当S=(22,333,0233)时,233是幸运数,2333、20233、3223不是幸运数。 给定N和S,计算不大于N的幸运数个数。 我 阅读全文
posted @ 2016-07-14 10:48 konjak魔芋 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Resource Archiver Time Limit: 10000MS Memory Limit: 100000KB 64bit IO Format: %I64d & %I64u Description Great! Your new software is almost finished! T 阅读全文
posted @ 2016-07-13 09:52 konjak魔芋 阅读(694) 评论(0) 推荐(0) 编辑
摘要:题意: 给定一个有n个节点的无根树,有两种装置A和B,每种都有无限多个。在某个节点X使用A装置需要C1的花费,并且此时与节点X相连的边都被覆盖。在某个节点X使用B装置需要C2的花费,并且此时与节点X相连的边以及与X相连的点相连的边都被覆盖。求覆盖所有边的最小花费。 分析: 首先无根树可以先dfs确定 阅读全文
posted @ 2016-03-10 17:15 konjak魔芋 阅读(628) 评论(0) 推荐(0) 编辑
摘要:题目: 分析: 其实就是两个dp结合起来。第一个dp求区间[l,r]全部合并起来要用的最小次数,可以用区间[l,k]&[k+1,r]转移(l<=k<r)。第二个dp求前i个娃娃分成多个套娃组最小合并次数。这两个动态规划都是很常规的。 我们考虑一个问题:怎样的区间才能弄成一个套娃组(即为1~p的互不相 阅读全文
posted @ 2016-03-08 13:31 konjak魔芋 阅读(898) 评论(1) 推荐(0) 编辑
摘要:题意: 给出两个字符串A,B将B分解成若干个子字符串,然后每个子字符串都要经过编辑变成字符串A,所有子串中编辑最多的次数即为当前状态下的最大编辑次数,要求求最小的最大编辑次数。 编辑操作包括修改、删除和插入。(|A|<=5000,|B|<=50) 分析: 因为A的长度较大,直接算出A每个区间对应B的 阅读全文
posted @ 2016-03-06 16:47 konjak魔芋 阅读(313) 评论(0) 推荐(1) 编辑
摘要:题意: 你经营者一直棒球队。在接下来的g+10天中有g(3<=g<=200)场比赛,其中每天最多一场比赛。你已经分析出你的n(5<=n<=100)个投手中每个人对阵所有m个对手的胜率(一个n*m矩阵),要求给出作战计划(即每天使用哪个投手),使得总胜场数的期望值最大。注意,一个投手在上场一次后至少要 阅读全文
posted @ 2016-03-06 15:41 konjak魔芋 阅读(548) 评论(1) 推荐(0) 编辑