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

我的方法(in),枚举+贪心。有点慢

Posted by xiaolonghingis at 2006-08-19 15:33:35 on Problem 2976
In Reply To:据说开始找比值最大的,每次找最优的和它合并可以过的,不知道能不能证明 Posted by:nuanran at 2006-08-19 14:45:21
因为答案c只可能在100到0之间,从大到小枚举c。假设答案为c,那么必然有                   
     100*(a1+.....+ak)
    -------------------- 〉=c ,两边同乘分母后得
       b1+.....+bk
    100*(a1+.....+ak)-c*(b1+.......+bk)>=0

    取100*ai-c*bi中最大的n-k个,看他们的和是否大于零即可。 

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