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 |
没错In Reply To:这样分配带宽错了吗? Posted by:ASCII at 2007-05-15 14:46:49 > rest=t; > for (i=1;i<=m;i++) > rest-=a[i].curr; > for (i=1;i<=m;i++) > a[i].dis=a[i].max-a[i].curr; > qsort(&a[1],m,sizeof(a[1]),cmp); > for (i=1;i<=m;i++) > { > ave=rest/(m+1-i); > if (ave>=a[i].dis) > { > a[i].curr=a[i].max; > rest-=a[i].dis; > } > else > { > a[i].curr+=ave; > rest-=ave; > } > } > 为什么是wrong answer 呢? Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator