Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

要先对数据预处理一下

Posted by bluesunxu at 2011-05-25 02:42:38 on Problem 1014 and last updated at 2011-05-25 02:44:08
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator