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 |
Re:我的方法(in),枚举+贪心。有点慢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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator