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 so_zt at 2011-08-26 15:35:01 on Problem 2054
将c[i] 排序 同时交换 father下标 tag下标
从最大的开始、
每次
set(int i)
{
   while(1)
   {
      if(tag[father[i]]==true) breal;
     else { 
        tag[i]=true;
        i=fatehr[i];}
}}

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