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 c0500448242 at 2005-07-18 19:42:29 on Problem 2489
In Reply To:就是比如在x轴上,已经在线段树上插入了(1, 10), 再插入(2, 9),那么怎么实现计算重叠?我想的方法会有重复的 Posted by:patina at 2005-07-18 19:33:30
比如:
2 9
2 9
3 8
1 10
排序后:
1 10
2 9
2 9
3 8
过程如下:
1 10
Query(1)   0//查询大于1 的点的数目
Insert(10)
2 9
Query(2)   1
Insert(9)
2 9
Query(2)   2
Insert(9)
3 8
Query(3)   3
Insert(8)
result     6
线段树就非得插入线段么?

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