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

splay写的wa了很久,总结了下原因

Posted by threedonkey at 2012-03-02 23:48:25 on Problem 3468
这是一组便于调试的数据,输出自己算算就可以了
5 10
1 2 3 4 5 
C 1 5 2
C 2 5 2
C 1 4 2
C 2 4 -100
C 2 5 3
C 1 4 4
C 3 5 3
Q 2 4
Q 3 5

错误1:
我定义的一个节点记录的是以这个节点为根的所有子树的总和,而我们在splay操作执行完后,很有可能更改的不是根节点,这是我们就需要将跟新向上传递
错误2:
查找节点是忘记了向下传递更新信息

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