BZOJ-1507 文本编辑器(Editor)
2014-08-09 22:56
176 查看
一道极其相似的题。。。http://hi.baidu.com/8361101/item/5b149103cbf4007cbee97e5f
就多了个区间查找,少了个翻转。。。
少了翻转的话貌似可以不用Splay?
反正我懒得去想。。。
每次操作复杂度均为O(lg n)
诶我貌似没讲如何区间查找。。。。。。
假设我们要查找区间[x,y],那么先Splay(y+1)再Splay(x-1),然后你就会发现树根的右子树的左字数就是我们要找的区间。
【Code】
就多了个区间查找,少了个翻转。。。
少了翻转的话貌似可以不用Splay?
反正我懒得去想。。。
每次操作复杂度均为O(lg n)
诶我貌似没讲如何区间查找。。。。。。
假设我们要查找区间[x,y],那么先Splay(y+1)再Splay(x-1),然后你就会发现树根的右子树的左字数就是我们要找的区间。
【Code】
相关文章推荐
- 【BZOJ1269/1507】[AHOI2006]文本编辑器editor Splay
- BZOJ_1269&&1507_[AHOI2006]文本编辑器editor&&[NOI2003]Editor
- 【bzoj1507】[NOI2003]Editor /【bzoj1269】[AHOI2006]文本编辑器editor Splay
- [NOI2003][bzoj1507] 文本编辑器 editor [splay]
- [BZOJ1269][AHOI2006]文本编辑器editor
- BZOJ1507 Editor
- bzoj1269: [AHOI2006]文本编辑器editor
- bzoj 1507: [NOI2003]Editor (块状链表)
- BZOJ 1507 Editor
- 【BZOJ-1507】Editor 块状链表
- 【BZOJ 1269】 [AHOI2006]文本编辑器editor
- 【bzoj1269】[AHOI2006]文本编辑器editor
- bzoj1269: [AHOI2006]文本编辑器editor rope
- bzoj 1269 [AHOI2006]文本编辑器editor 块状链表
- 【bzoj1269】【AHOI2006】文本编辑器editor【Splay】
- BZOJ1269 文本编辑器Editor
- 【BZOJ1269】[AHOI2006]文本编辑器editor Splay
- 【BZOJ 1507】[NOI2003]Editor
- [NOI2003]Editor & [AHOI2006]文本编辑器editor BZOJ1507&BZOJ1269
- [题解]bzoj1507(NOI2003)Editor