Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
要先对数据预处理一下In Reply To:我能用的办法都用了,DFS,背包,动态规划,几乎每一种都能过BBS的测试数据,但是就是TLE Posted by:lovexinbao at 2011-05-24 13:18:25 我没做过这题,就讲一点思路你参考一下。 因为只有六种石头,两个人平分,所以首先将所有同一种类的石头均分。比如价格为1的石头有5颗,每人就先分到2颗,剩下一颗;如果价格为2的石头有6颗,每人就分到3颗。(a[i] = a[i] %2) 这样,最后从1-6就剩下1颗或0颗。然后再看能不能均分这些剩下的石头。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator