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 4Meal at 2006-03-25 00:44:10 on Problem 2786
pop_heap(stack,stack+ct,cmp);
stack[ct-1] = s[i].q;
push_heap(stack,stack+ct,cmp);


         // stack[0]=s[i].q;
         // pop_heap(stack,stack+ct,cmp);
         // push_heap(stack,stack+ct,cmp);

这两段代码等效么?怎么都能过?pop_heap不是把最后一个元素加到堆头,然后 shift_down 么?

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