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 madongtest at 2006-08-20 02:19:15 on Problem 2976
In Reply To:我的方法(in),枚举+贪心。有点慢 Posted by:xiaolonghingis at 2006-08-19 15:33:35
> 因为答案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