随笔分类 -  DP

摘要:PiecesTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 101Accepted Submission(s): 54 Problem DescriptionYou heart broke into pieces.My string broke into pieces.But you will recover one day,and my string will never go back. Given a string s.We can 阅读全文
posted @ 2013-07-30 18:46 剑不飞 阅读(568) 评论(0) 推荐(0)
摘要:X mod f(x)Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1297Accepted Submission(s): 568 Problem DescriptionHere is a function f(x): int f ( int x ) { if ( x == 0 ) return 0; return f ( x / 10 ) + x % 10; } Now, you want to ... 阅读全文
posted @ 2013-07-29 20:14 剑不飞 阅读(1799) 评论(0) 推荐(0)
摘要:GameTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 336Accepted Submission(s): 92 Problem Description Nowadays, there are more and more challenge game on TV such as 'Girls, Rush Ahead'. Now, you participate int a game like this. There are 阅读全文
posted @ 2013-07-26 15:27 剑不飞 阅读(430) 评论(0) 推荐(0)
摘要:DequeTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 613Accepted Submission(s): 180 Problem DescriptionToday, the teacher gave Alice extra homework for the girl weren't attentive in his class. It's hard, and Alice is going to turn to you f 阅读全文
posted @ 2013-07-24 11:55 剑不飞 阅读(516) 评论(0) 推荐(0)
摘要:E -MissileTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 4354DescriptionLong long ago,there is a strange area where all the C cities are located in a straight line.To make things easy,lets regard the line as X axis.Even more strangely,cities belonging t 阅读全文
posted @ 2013-07-20 16:51 剑不飞 阅读(195) 评论(0) 推荐(0)
摘要:C -XHXJ's LISTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 4352Description#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 阅读全文
posted @ 2013-07-20 15:31 剑不飞 阅读(197) 评论(0) 推荐(0)
摘要:Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic memory and this may not trouble him, Neal gives it to Jiejie.Since Jiejie can't remember numbers clearly, he just uses sticks to help himself. Allowing for Jiejie' 阅读全文
posted @ 2013-07-11 17:05 剑不飞 阅读(148) 评论(0) 推荐(0)
摘要:Unfair NimTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 662Accepted Submission(s): 271Problem DescriptionAlice and Bob are tired of playing the Nim game, because they are so clever that before the beginning of the game, they have already known 阅读全文
posted @ 2013-06-05 13:19 剑不飞 阅读(273) 评论(0) 推荐(0)
摘要:Save the dwarfsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 926Accepted Submission(s): 281Problem DescriptionSeveral dwarfs are trapped in a deep well. They are not tall enough to climb out of the well, so they want to make a human-pyramid, that 阅读全文
posted @ 2013-06-01 10:16 剑不飞 阅读(215) 评论(0) 推荐(0)
摘要:Hourai JeweledTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 808Accepted Submission(s): 289Problem DescriptionKaguya Houraisan was once a princess of the Lunarians, a race of people living on the Moon. She was exiled to Earth over a thousand yea 阅读全文
posted @ 2013-05-30 09:31 剑不飞 阅读(213) 评论(0) 推荐(0)
摘要:Divide ChocolateTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1276Accepted Submission(s): 607Problem DescriptionIt is well known that claire likes dessert very much, especially chocolate. But as a girl she also focuses on the intake of calories e 阅读全文
posted @ 2013-05-29 19:30 剑不飞 阅读(341) 评论(0) 推荐(0)
摘要:Dart gameTime Limit 1000msMemory Limit 65536Kdescription Darts originated in Australia. Australia's aborigines initially for hunting and hit the enemy's weapon. A game of darts in which the players attempt to score points by throwing the darts at a target. Figure:DART BOARD Darts movement r. 阅读全文
posted @ 2013-05-05 20:02 剑不飞 阅读(184) 评论(0) 推荐(0)
摘要:Unidirectional TSPBackgroundProblems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI routing problems is minimizing wire length. The Traveling Salesperson Problem (TSP) -- finding whether all the cities in 阅读全文
posted @ 2013-05-04 21:31 剑不飞 阅读(187) 评论(0) 推荐(0)
摘要:10003 - Cutting SticksTime limit: 3.000 seconds思路:水啊,dp[a][b]a到b之间全切完的最小值。 dp[a][b]=min(dp[a][k]+dp[k][b])+ab段长度。k为ab段中的切点。#include #include #include using namespace std; const int mm=55; const int oo=1e9; int f[mm]; int dp[mm][mm];///a到b之间的最优值 int ans; int DP(int a,int b) { if(dp[a][b])return... 阅读全文
posted @ 2013-05-04 19:54 剑不飞 阅读(144) 评论(0) 推荐(0)
摘要:Stacking BoxesBackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbitrary dimensions. Consider solving differential equations in several dimensions and analyzing the topology of ann-dimensional hypercube. The form 阅读全文
posted @ 2013-05-03 12:14 剑不飞 阅读(223) 评论(0) 推荐(0)
摘要:English GameTime Limit 1000msMemory Limit 65536Kdescription This English game is a simple English words connection game. The rules are as follows: there are N English words in a dictionary, and every word has its own weight v. There is a weight if the corresponding word is used. Now there is a ta... 阅读全文
posted @ 2013-04-29 21:11 剑不飞 阅读(169) 评论(0) 推荐(0)
摘要:BalanceTime Limit:1000MSMemory Limit:30000KTotal Submissions:8334Accepted:5059DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.It orders two arms of negligible weight and each arm's length is 15. Some h 阅读全文
posted @ 2013-04-26 10:49 剑不飞 阅读(157) 评论(0) 推荐(0)
摘要:动态规划的特点及其应用目 录(点击进入)【关键词】【摘要】【正文】§1动态规划的本质§1.1多阶段决策问题§1.2阶段与状态§1.3决策和策略§1.4最优化原理与无后效性§1.5最优指标函数和规划方程§2动态规划的设计与实现§2.1动态规划的多样性§2.2动态规划的模式性§2.3动态规划的技巧性§3动态规划与一些算法的比较§3.1动态规划与递推§3.2动态规划与搜索§3.3动态规划与网络流§4结语【附录:部分试题与源程序】1.“花店橱窗布置问题” 阅读全文
posted @ 2013-04-25 14:09 剑不飞 阅读(2013) 评论(0) 推荐(0)
摘要:RelocationTime Limit:1000MSMemory Limit:65536KTotal Submissions:1411Accepted:574DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they only have two compact cars, 阅读全文
posted @ 2013-04-24 21:22 剑不飞 阅读(203) 评论(0) 推荐(0)