------动态规划--------
文章平均质量分 62
CrossDolphin
青春看起来如此完美,没空闲去浪费时间。
展开
-
Codeforces Round #374 (Div. 2) C bfs+dp
链接:戳这里C. Journeytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Irina arrived to one of the most famous cities of Ber原创 2016-10-01 15:19:20 · 413 阅读 · 0 评论 -
Codeforces Round #360 (Div. 2) E dp 类似01背包
链接:戳这里E. The Values You Can Maketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPari wants to buy an expensive chocolate from原创 2016-07-06 16:03:22 · 454 阅读 · 0 评论 -
bzoj 4027 树形dp
链接:戳这里4027: [HEOI2015]兔子与樱花Time Limit: 10 Sec Memory Limit: 256 MB[Submit][Status][Discuss]Description很久很久之前,森林里住着一群兔子。有一天,兔子们突然决定要去看樱花。兔子们所在森林里的樱花树很特殊。樱花树由n个树枝分叉点组成,编号从0到n-1,这n个分原创 2016-07-15 21:54:35 · 348 阅读 · 0 评论 -
Codeforces Round #362 (Div. 2) D 树形dp
链接:戳这里D. Puzzlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBarney lives in country USC (United States of Charzeh). USC has原创 2016-07-15 16:22:30 · 1109 阅读 · 5 评论 -
hdu 1561 树形dp
链接:戳这里The more, The BetterTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许原创 2016-07-14 20:40:53 · 269 阅读 · 0 评论 -
Codeforces Round #316 (Div. 2) E dp
链接:戳这里E. Pig and Palindromestime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeppa the Pig was walking and walked into the fore原创 2016-07-14 18:56:57 · 311 阅读 · 0 评论 -
Educational Codeforces Round 13 E 状压dp
链接:戳这里E. Another Sith Tournamenttime limit per test2.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe rules of Sith Tournament are well known原创 2016-07-25 21:29:42 · 302 阅读 · 0 评论 -
Codeforces Round #358 (Div. 2) D dp
链接:戳这里D. Alyona and Stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter returned from forest, Alyona started reading a原创 2016-07-02 22:18:07 · 295 阅读 · 0 评论 -
hdu 5691 状压dp
链接:戳这里Sitting in LineTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Problem Description度度熊是他同时代中最伟大的数学家,一切数字都要听命于他。现在,又到了度度熊和他的数字仆人们玩排排坐游戏的时候原创 2016-07-13 22:17:52 · 241 阅读 · 0 评论 -
Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2) D 双向dp
链接:戳这里D. Bear and Blockstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little bear who loves to play. Today he is p原创 2016-07-13 14:48:36 · 272 阅读 · 0 评论 -
Codeforces Round #302 (Div. 2) C dp(背包思想)
链接:戳这里C. Writing Codetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProgrammers working on a large project have just received原创 2016-07-24 13:00:34 · 712 阅读 · 0 评论 -
Codeforces Round #323 (Div. 2) D LIS 最长上升子序列
链接:戳这里D. Once Again...time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of positive integers a1, a2, ...,原创 2016-07-08 21:26:24 · 356 阅读 · 0 评论 -
Codeforces Round #336 (Div. 2) C 二分+dp
链接:戳这里C. Chain Reactiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n beacons located at distinct positions on a原创 2016-07-08 22:47:29 · 333 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2) D 递推
链接:戳这里D. Flowerstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe saw the little game Marmot made for Mole's lunch. Now it'原创 2016-07-29 21:26:43 · 285 阅读 · 0 评论 -
Codeforces Round #263 (Div. 2) D 树形dp
链接:戳这里D. Appleman and Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAppleman has a tree with n vertices. Some of the ver原创 2016-09-21 21:41:11 · 351 阅读 · 0 评论 -
hdu 5900 区间dp
链接:戳这里QSC and MasterTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionEvery school has some legends, Northeastern University原创 2016-09-19 08:48:22 · 1530 阅读 · 0 评论 -
Codeforces Round #371 (Div. 2) E dp
链接:戳这里E. Sonya and Problem Wihtout a Legendtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSonya was unable to think of a story原创 2016-09-16 21:08:18 · 338 阅读 · 0 评论 -
Codeforces Round #367 (Div. 2) dp
链接:戳这里C. Hard problemtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasiliy is fond of solving different tasks. Today he found原创 2016-08-12 15:15:28 · 268 阅读 · 0 评论 -
Codeforces Round #369 (Div. 2) C dp
链接:戳这里C. Coloring Treestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZS the Coder and Chris the Baboon has arrived at Udayla原创 2016-08-30 16:47:30 · 327 阅读 · 0 评论 -
hdu 5791 dp
链接:戳这里TwoTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionAlice gets two sequences A and B. A easy problem comes. How many pa原创 2016-08-05 19:50:06 · 357 阅读 · 0 评论 -
Codeforces Round #286 (Div. 2) C dp
链接:戳这里C. Mr. Kitayuta, the Treasure Huntertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Shuseki Islands are an archipelag原创 2016-08-04 11:18:33 · 350 阅读 · 0 评论 -
Codeforces Round #363 (Div. 2) C dp
链接:戳这里C. Vacationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has n days of vacations! So he decided to improve his I原创 2016-07-20 12:46:14 · 309 阅读 · 0 评论 -
Codeforces Round #105 (Div. 2) E 01背包
链接:戳这里E. Porcelaintime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring her tantrums the princess usually smashes some collect原创 2016-07-30 13:22:08 · 253 阅读 · 0 评论 -
Codeforces Round #105 (Div. 2) D 概率dp
链接:戳这里D. Bag of micetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe dragon and the princess are arguing about what to do o原创 2016-07-30 13:14:49 · 316 阅读 · 0 评论 -
Codeforces Round #336 (Div. 2) D 区间dp
链接:戳这里D. Zumatime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputGenos recently installed the game Zuma on his phone. In Zuma ther原创 2016-07-12 21:08:53 · 290 阅读 · 0 评论 -
BestCoder Round #84 1002 hdu 5748 最长上升子序列
链接:戳这里BellovinTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionPeter has a sequence a1,a2,...,an and he define a function o原创 2016-07-23 22:05:44 · 845 阅读 · 0 评论 -
Codeforces Round #303 (Div. 2) C dp
链接:戳这里C. Woodcutterstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Susie listens to fairy tales before bed every day. T原创 2016-07-22 17:43:08 · 336 阅读 · 0 评论 -
Uva 10891 dp
链接:戳这里This is a two player game. Initially there are n integer numbers in an array and players A and B getchance to take them alternatively. Each player can take one or more numbers from the l原创 2016-03-24 21:23:40 · 319 阅读 · 0 评论 -
Uva 10635 简单dp
链接:戳这里Problem EPrince and PrincessInput: Standard InputOutput: Standard OutputTime Limit: 3 SecondsIn an n x n chessboard, Prince and Princess plays a game. The squares in原创 2016-03-24 21:01:21 · 431 阅读 · 0 评论 -
BestCoder Round #78 (div.2) A B
链接:戳这里CA Loves Stick Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)问题描述CA喜欢玩木棍。有一天他获得了四根木棍,他想知道用这些木棍能不能拼成一个四边形。(四边形定义:https://en.wikipedia.org/w原创 2016-04-02 23:00:04 · 385 阅读 · 0 评论 -
BestCoder Round #76 (div.2) A B C
链接:戳这里DZY Loves Balls Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)问题描述DZY喜欢玩球。他有n个球,装进一个大盒子里。每个球上面都写着一个整数。有一天他打算从盒子中挑两个球出来。他先均匀随机地从盒子中挑原创 2016-03-20 22:34:01 · 419 阅读 · 0 评论 -
Codeforces Round #343 (Div. 2) A B C D
链接:戳这里A. Far Relative’s Birthday Caketime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDoor's family is going celebrate Famil Doors's原创 2016-03-20 22:05:25 · 654 阅读 · 0 评论 -
BestCoder Round #75
题目链接:戳这里King's Cake Accepts: 960 Submissions: 1572 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述阅兵式前一天,是国王的生日,大臣们为他准备了一个n×m(1≤n,m≤10000) 的蛋糕。他准备原创 2016-03-13 19:26:25 · 332 阅读 · 0 评论 -
HDU5074
Hatsune MikuTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 619 Accepted Submission(s): 445Problem DescriptionHatsune Miku is a p原创 2014-12-11 15:33:51 · 562 阅读 · 0 评论 -
区间dp
http://www.tyvj.cn/p/1056描述 在Mars星球上,每个Mars人都随身佩带着一串能量项链。在项链上有N颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标记。因为只有这样,通过吸盘(吸盘是Mars人吸收能量的一种器官)的作用,这两颗珠子才能聚合成原创 2015-01-30 16:27:23 · 468 阅读 · 0 评论 -
最长上升(下降)子序列 O(nlogn)
http://www.rqnoj.cn/problem/156题目描述镇里举办贪吃比赛,一共比赛N天,规定:每次吃的必须比上次多,一天只能吃一次(撑死...),吃的天数最多的人将获得胜利,获得10000000000 mod 10 的奖金^_^现在,Sally要参加比赛,她邀请参加OI的你一起帮忙,胜利后七三分成^_^输入格式第一行一个数N,表原创 2015-02-03 13:52:39 · 609 阅读 · 0 评论 -
区间dp
http://codevs.cn/problem/1392/题目描述 Description在一个园形操场的四周站着N个傻子,现要将傻子有次序地合并成一堆.规定每次只能选相邻的2个傻子合并成新的一个傻子,并将新的一个傻子的RP数,记为该次合并的RP数。将N个傻子合并成1个的最小RP数为RPn和最大RP数为RPx.钟某人要合并他们,钟某人现在的RP为m,但原创 2015-02-03 13:58:06 · 577 阅读 · 0 评论 -
Codeforces Round #346 (Div. 2) G 递推
链接:戳这里G. Fence Divercitytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLong ago, Vasily built a good fence at his country hou原创 2016-04-07 21:20:03 · 421 阅读 · 0 评论 -
BestCoder Round #77 (div.2) A B C D
链接:戳这里so easy Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述已知一个包含 nn 个元素的正整数集合 SS,设 f(S)为集合 S 中所有元素的异或(XOR)的结果。如:S={1,2,3}, 则 f(S) = 0。原创 2016-03-26 22:59:05 · 426 阅读 · 0 评论 -
第五届华中区程序设计邀请赛暨武汉大学第十四届校赛 Problem 1608 - Calculation
链接:戳这里Problem 1608 - CalculationTime Limit: 500MS Memory Limit: 65536KB DescriptionToday, Alice got her math homework again!She had n integers, and she needed to divide them into原创 2016-04-11 22:15:53 · 887 阅读 · 0 评论