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 |
并查集小规模数据按时间排序直接贪心; 此题,按利润排序,然后用以时间为并查集+贪心; 当谈得一个物品后,这个天数的父结点设为该天数减1; //init fa[i] = i; if ((td = find(product[i].day)) > 0) { totalp += product[i].p; fa[td] = td - 1;//即下一个deadline为td的物品只能是td-1天卖了 } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator