摘要: 可以先将问题建模为 : 物品大小为1~inf 且每件物品数量无限 的背包选体积为1~n的方案数。 显然物品体积只有1~n有用,我们不妨把 体积1~sqrt(n) 的物品先暴力插入到背包中,设这一部分最后 体积i的方案数是 A[i] 。 考虑体积>sqrt(n)的物品怎么计算方案,可以发现这样的物品最 阅读全文
posted @ 2018-04-26 20:51 蒟蒻JHY 阅读(646) 评论(0) 推荐(0) 编辑
摘要: Discription As you know, the most intelligent beings on the Earth are, of course, cows. This conclusion was reached long ago by the Martian aliens, as 阅读全文
posted @ 2018-04-26 11:02 蒟蒻JHY 阅读(385) 评论(0) 推荐(0) 编辑
摘要: Discription As you must know, the maximum clique problem in an arbitrary graph is NP-hard. Nevertheless, for some graphs of specific kinds it can be s 阅读全文
posted @ 2018-04-26 10:06 蒟蒻JHY 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 看样例猜结论hhhhhh,竟然蒙对了。。(正确性待证明) 阅读全文
posted @ 2018-04-26 09:10 蒟蒻JHY 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 可以很简单的推出每个数a[i]最后对答案的的贡献系数是 C(n-1,i-1) / 2^(n-1) ,但是不能直接照着这么算,,精度会爆炸。 我们取一下对数,就可以直接做了(注意因为负数不能取对数,所以加一个负数就相当于减它的相反数) 阅读全文
posted @ 2018-04-26 08:32 蒟蒻JHY 阅读(251) 评论(0) 推荐(0) 编辑