博弈dp
71kg
这个作者很懒,什么都没留下…
展开
-
UVA 10891 Game of Sum(博弈dp)
题目大意:给你n个数,两个人轮流取,可以从左边开始去取连续的任意个,或者从右边取连续的任意个, 注意不能从两头取,所有的数都被取完游戏结束,输出先手与后手的分差; 解析:dp[i][j] 表示i~j区间内先手取的最大值,所以dp[1][n]表示的是取完所有数之后的最大值, 由于求的是最大值,所以给后手留下最小的,分两种情况,1.留给后手i+1~r区间;2.给后手留l~k区间 所以结...原创 2019-02-03 19:40:28 · 297 阅读 · 0 评论 -
Nim POJ - 2068 博弈dp
Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly). We play in turn and at each turn, you or I can ...原创 2019-02-07 00:49:34 · 201 阅读 · 0 评论 -
Gems Fight! HDU - 4778 (博弈dp+状态压缩)
Alice and Bob are playing "Gems Fight!": There are Gems of G different colors , packed in B bags. Each bag has several Gems. G different colors are numbered from color 1 to color G. Alice and B...原创 2019-02-07 02:04:56 · 271 阅读 · 0 评论