摘要: Splay要支持找最左侧的最小值所在的位置。类似线段树一样处理一下,如果左子树最小值等于全局最小值,就查左子树;否则如果当前节点等于全局最小值,就查当前节点;否则查右子树。 为了统计答案,当然还得维护子树大小的函数。 找到位置以后,直接将左右子树交换即可。不需要打标记。 删除节点时,直接将其前驱(是 阅读全文
posted @ 2017-07-15 16:41 AutSky_JadeK 阅读(176) 评论(0) 推荐(0)
摘要: #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<stack> using namespace std; #define maxn 100010 #define INF 2147483 阅读全文
posted @ 2017-07-15 15:04 AutSky_JadeK 阅读(140) 评论(0) 推荐(0)
摘要: #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; #define maxn 1000000 #define INF 2147483647 int n,fa[ma 阅读全文
posted @ 2017-07-15 14:06 AutSky_JadeK 阅读(217) 评论(0) 推荐(0)
TVアニメ「Charlotte(シャーロット)」公式サイト TVアニメ「Charlotte(シャーロット)」公式サイト