蒟蒻(强调这个词)Splay区间翻

P3391 【模板】文艺平衡树

您太ju了%%%
by ouuan @ 2018-10-28 22:05:23


@[ouuan](/space/show?uid=49742) 您太jù了orz
by 萌田薰子 @ 2018-10-28 22:07:50


不会splay…… 帮不了你了
by 花里心爱 @ 2018-10-28 22:10:48


@[一之濑琴美](/space/show?uid=72408) 应该Splay第k大而不是k号节点吧...翻转后顺序不是序号QAQ
by ouuan @ 2018-10-28 22:11:07


@[Irressey](/space/show?uid=79017) 嗯~~实在不行我还可以膜标~~
by 萌田薰子 @ 2018-10-28 22:12:44


@[ouuan](/space/show?uid=49742) 我我我翻不是按位置的吗QAQ
by 萌田薰子 @ 2018-10-28 22:13:21


@[一之濑琴美](/space/show?uid=72408) 您连kth()都没有QAQ,您不是按编号翻的吗
by ouuan @ 2018-10-28 22:16:31


@[ouuan](/space/show?uid=49742) 其实我不太能理解您的意思QvQ~~(感觉要变成神仙聊天了)~~
by 萌田薰子 @ 2018-10-28 22:21:09


突然不知所措
by 萌田薰子 @ 2018-10-28 22:21:43


@[一之濑琴美](/space/show?uid=72408) Splay(x,goal)是把x号节点旋转到goal的儿子处,应该转kth(x)而不是xQAQ (摘自我的代码) ``` void rever(int l,int r) { int ll=kth(l); int rr=kth(r+2); splay(ll,0); splay(rr,ll); s[s[rr].ch[0]].tag^=1; swap(s[s[rr].ch[0]].ch[0],s[s[rr].ch[0]].ch[1]); } ```
by ouuan @ 2018-10-28 22:23:49


| 下一页