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:请问ac 的朋友用什么方法做的,给点提示啊In Reply To:请问ac 的朋友用什么方法做的,给点提示啊 Posted by:0812800229 at 2010-04-06 15:55:50 http://blog.sina.com.cn/jeogia 容易知道,每台电脑的下载速度vi * t = fi 立即得: vi = (pi * bi) / (pi + bi),假设选了k台,则总速度为sigema(vi) 0 < i < k sigema为求和符号。 每台电脑需要的时间(也是总时间,因为要同步) 为 t = F / sigema(vi); 总花费为 sigema(vi * fi) = sigema(t * vi * ci). 其中t * vi = fi 设xi = vi * ci 总花费即为: cost = F * (x0 + x1 + ... + xk-1) / (v0 + v1 + ... + vk-1),F为定值 把右边的分母乘到左边,即设 y = sigema(cost * vi - F * xi) = 0 二分枚举cost,对于每个cost,把0~n台电脑的cost * vi - F * xi排序,去最小的前k个,求和得y, 如果y > 0 cost 偏大,否则偏小,符合二分策略。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator