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:wa 无数次。。。。。。。谁来救救我:( Posted by:273544537 at 2007-04-02 21:55:33 > 我的做法: > 将堆转为一个序列s (就是后序遍历) > 例如: > 1 > 2 3 > 4 5 6 7 > > 转为: 4 5 2 6 7 3 1 > > 然后定义p[i]=s[i]-i > 然后求出p 的最长不下降序列的长度l > 然后用 ans=n-l > n为堆元素个数 > > 为什么会错呢? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator