随笔分类 -  动态规划 记忆化搜索

摘要:题目链接:点这里 题意: 1~N标号的球 现在A有C个,B有C个 每次可以随机得到D个不同的球(1~N);问你A或B中的C个球都出现一次的 期望次数 题解: dp[i][j][k]表示 随机出现了i个仅仅属于A的球的个数,仅仅属于B的球的个数,同时属于A,B的球的个数 阅读全文
posted @ 2017-04-23 20:09 meekyan 阅读(620) 评论(0) 推荐(0)
摘要:Cake slicing A rectangular cake with a grid of m×n unit squares on its topneeds to be sliced into pieces. Several cherries are scatteredon the top of 阅读全文
posted @ 2016-04-26 22:55 meekyan 阅读(397) 评论(0) 推荐(0)
摘要:F Fighting for Triangles DescriptionAndy and Ralph are playing a two-player game on a triangular board that looks like the following:1 234 ... 阅读全文
posted @ 2016-01-16 21:19 meekyan 阅读(251) 评论(0) 推荐(0)
摘要:Alexander Charles McMillan loves to gamble, and during his last trip to the casino he ran across a new game. It is played on a linear sequence of squa... 阅读全文
posted @ 2016-01-15 13:46 meekyan 阅读(565) 评论(0) 推荐(0)
摘要:B. Longtail HedgehogThis Christmas Santa gave Masha a magic picture and a pencil. The picture consists ofnpoints connected bymsegments (they might cro... 阅读全文
posted @ 2016-01-09 00:50 meekyan 阅读(193) 评论(0) 推荐(0)
摘要:1079: [SCOI2008]着色方案Description有n个木块排成一行,从左到右依次编号为1~n。你有k种颜色的油漆,其中第i种颜色的油漆足够涂ci个木块。所有油漆刚好足够涂满所有木块,即c1+c2+...+ck=n。相邻两个木块涂相同色显得很难看,所以你希望统计任意两个相邻木块颜色不同的... 阅读全文
posted @ 2016-01-07 15:22 meekyan 阅读(356) 评论(0) 推荐(1)
摘要:D. ZumaGenos recently installed the game Zuma on his phone. In Zuma there exists a line ofngemstones, thei-th of which has colorci. The goal of the ga... 阅读全文
posted @ 2015-12-24 16:43 meekyan 阅读(311) 评论(0) 推荐(0)
摘要:PermutationProblem DescriptionThere is an arrangement of N numbers and a permutation relation that alter one arrangement into a... 阅读全文
posted @ 2015-08-21 00:34 meekyan 阅读(357) 评论(0) 推荐(0)
摘要:Problem H: Two EndsIn the two-player game “Two Ends”, an even number of cards is laid out in a row. On each card, faceup, is written a positive intege... 阅读全文
posted @ 2015-08-18 20:22 meekyan 阅读(326) 评论(0) 推荐(0)