随笔分类 -  Splay Tree

伸展树
ZOJ 3765 Lights (伸展树splay)
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3765LightsTime Limit:8 Seconds Memory Limit:131072 KBNow you haveNlights in a line. Don't worry - the lights don't have color. The only status they have is on and off. And, each light has a value, too.There is a boring student 阅读全文

posted @ 2014-03-02 21:44 kuangbin 阅读(1745) 评论(0) 推荐(0) 编辑

HDU 4453 Looploop (伸展树splay tree)
摘要:LooploopTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 781Accepted Submission(s): 220Problem DescriptionXXX gets a new toy named Looploop. The toy has N elements arranged in a loop, an arrow pointing to one of the elements, and two preset paramete 阅读全文

posted @ 2013-10-23 00:26 kuangbin 阅读(946) 评论(0) 推荐(0) 编辑

HDU 3726 Graph and Queries (离线处理+splay tree)
摘要:Graph and QueriesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1467Accepted Submission(s): 301Problem DescriptionYou are given an undirected graph with N vertexes and M edges. Every vertex in this graph has an integer value assigned to it at the 阅读全文

posted @ 2013-08-30 19:31 kuangbin 阅读(1652) 评论(0) 推荐(0) 编辑

POJ 3580 SuperMemo (splay tree)
摘要:SuperMemoTime Limit:5000MSMemory Limit:65536KTotal Submissions:6841Accepted:2268Case Time Limit:2000MSDescriptionYour friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, { 阅读全文

posted @ 2013-08-28 21:30 kuangbin 阅读(982) 评论(0) 推荐(0) 编辑

BZOJ 1500: [NOI2005]维修数列 (splay tree)
摘要:1500: [NOI2005]维修数列Time Limit:10 SecMemory Limit:64 MBSubmit:4229Solved:1283[Submit][Status]DescriptionInput输入文件的第1行包含两个数N和M,N表示初始时数列中数的个数,M表示要进行的操作数目。第2行包含N个数字,描述初始时的数列。以下M行,每行一条命令,格式参见问题描述中的表格。Output对于输入数据中的GET-SUM和MAX-SUM操作,向输出文件依次打印结果,每个答案(数字)占一行。Sample Input9 82 -6 3 5 1 -5 -3 6 3GET-SUM 5 4MAX 阅读全文

posted @ 2013-08-28 19:18 kuangbin 阅读(3392) 评论(0) 推荐(0) 编辑

BZOJ 1269: [AHOI2006]文本编辑器editor (splay tree)
摘要:1269: [AHOI2006]文本编辑器editorTime Limit:10 SecMemory Limit:162 MBSubmit:1213Solved:454[Submit][Status]Description这些日子,可可不和卡卡一起玩了,原来可可正废寝忘食的想做一个简单而高效的文本编辑器。你能帮助他吗?为了明确任务目标,可可对“文本编辑器”做了一个抽象的定义:文本:由0个或多个字符构成的序列。这些字符的ASCII码在闭区间[32, 126]内,也就是说,这些字符均为可见字符或空格。光标:在一段文本中用于指示位置的标记,可以位于文本的第一个字符之前,文本的最后一个字符之后或文本的 阅读全文

posted @ 2013-08-27 03:05 kuangbin 阅读(1569) 评论(0) 推荐(0) 编辑

HDU 3487 Play with Chain (splay tree)
摘要:Play with ChainTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2783Accepted Submission(s): 1141Problem DescriptionYaoYao is fond of playing his chains. He has a chain containing n diamonds on it. Diamonds are numbered from 1 to n.At first, the diam 阅读全文

posted @ 2013-08-26 22:34 kuangbin 阅读(1036) 评论(0) 推荐(1) 编辑

HDU 3436 Queue-jumpers (splay tree)
摘要:Queue-jumpersTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1821Accepted Submission(s): 425Problem DescriptionPonyo and Garfield are waiting outside the box-office for their favorite movie. Because queuing is so boring, that they want to play a ga 阅读全文

posted @ 2013-08-25 22:23 kuangbin 阅读(807) 评论(0) 推荐(0) 编辑

HDU 1890 Robotic Sort (splay tree)
摘要:Robotic SortTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1640Accepted Submission(s): 711Problem DescriptionSomewhere deep in the Czech Technical University buildings, there are laboratories for examining mechanical and electrical properties of v 阅读全文

posted @ 2013-08-25 11:07 kuangbin 阅读(1756) 评论(0) 推荐(0) 编辑

POJ 3468 A Simple Problem with Integers (splay tree入门)
摘要:A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:47944Accepted:14122Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv 阅读全文

posted @ 2013-08-24 23:16 kuangbin 阅读(1315) 评论(0) 推荐(0) 编辑

1588: [HNOI2002]营业额统计 (splay tree)
摘要:1588: [HNOI2002]营业额统计Time Limit:5 SecMemory Limit:162 MBSubmit:5783Solved:1859[Submit][Status]Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。 Tiger拿出了公司的账本,账本上记录了公司成立以来每天的营业额。分析营业情况是一项相当复杂的工作。由于节假日,大减价或者是其他情况的时候,营业额会出现一定的波动,当然一定的波动是能够接受的,但是在某些时候营业额突变得很高或是很低,这就证明公司此时的经营状况出现了问题 阅读全文

posted @ 2013-08-24 22:08 kuangbin 阅读(815) 评论(0) 推荐(0) 编辑

Splay Tree(伸展树总结)
摘要:伸展树是比较神奇的,它可以做很多线段树不能实现的事情。最近做伸展树做了好长时间了,现在重新把题目整理下,代码统一些一下呢。说明多是含在代码的注释中。刚开始学,可以看论文,然后按照别人的代码去写。我是参照cxlove大神学习的:http://blog.csdn.net/acm_cxlove/article/details/7815019还有HH的:http://www.notonlysuccess.com/index.php/splay-tree/学习算法只有经过自己不断写了才能完全掌握,代码风格也要适合自己的。1、POJ 3468 A Simple Problem with Integers 阅读全文

posted @ 2013-04-21 17:26 kuangbin 阅读(4803) 评论(0) 推荐(0) 编辑

[HNOI2002]营业额统计 Splay tree入门题
摘要:[HNOI2002]营业额统计题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1588[HNOI2002]营业额统计Time Limit:5 SecMemory Limit:162 MBSubmit:4128Solved:1305[Submit][Status][Discuss]Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。 Tiger拿出了公司的账本,账本上记录了公司成立以来每天的营业额。分析营业情况是一项相当复杂的工作。由于节假日,大减价 阅读全文

posted @ 2013-03-17 15:47 kuangbin 阅读(2492) 评论(2) 推荐(1) 编辑

【转】【伸展树Splay Tree】
摘要:作者:Dong | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址:http://dongxicheng.org/structure/splay-tree/1、 概述二叉查找树(Binary Search Tree,也叫二叉排序树,即Binary Sort Tree)能够支持多种动态集合操作,它可以用来表示有序集合、建立索引等,因而在实际应用中,二叉排序树是一种非常重要的数据结构。从算法复杂度角度考虑,我们知道,作用于二叉查找树上的基本操作(如查找,插入等)的时间复杂度与树的高度成正比。对一个含n个节点的完全二叉树,这些操作的最坏情况运行时间为O(log n)。但如果因 阅读全文

posted @ 2012-10-07 15:21 kuangbin 阅读(7665) 评论(4) 推荐(0) 编辑

导航

JAVASCRIPT: