难道我的splay写成了spaly?

P2286 [HNOI2004] 宠物收养场

@[smarthehe](/space/show?uid=103732) 看一看[这道题](https://www.luogu.org/problemnew/show/P3721)
by sanaka87 @ 2019-06-08 20:50:28


@[Owen_codeisqueen](/space/show?uid=77426) 感谢!!!orz 我自己再想一下单旋和双旋的准确性吧 (另:日报毒害萌新石锤了qaq,日报链接是我签名里的splay那个链接)
by smarthehe @ 2019-06-08 21:06:04


@[Owen_codeisqueen](/space/show?uid=77426) 还有 普通平衡树模板居然放spaly过了
by smarthehe @ 2019-06-08 21:08:10


那个……其实Splay rand()一下效率可能很高……
by Stay_Hungry @ 2019-06-08 21:10:37


@[smarthehe](/space/show?uid=103732) 没事的 普通平衡树居然过了qwq
by sanaka87 @ 2019-06-08 21:15:37


splay+O2=AC splay△=20%TLE+80%AC
by DARKSTALKING @ 2019-06-08 21:16:19


splay+O2=AC splay△=20%TLE+80%AC
by DARKSTALKING @ 2019-06-08 21:16:41


@[smarthehe](/space/show?uid=103732) 日报没有问题, 是你抄错了
by CeLaMbDa @ 2019-06-08 21:28:29


@[CeLaMbDa](/space/show?uid=109226) 是的qwq 星际玩家
by smarthehe @ 2019-06-09 16:28:43


正常的 cosplay() 操作不是 ```cpp void cosplay(struct s_node **c, int k) { int d1, d2; int l; assert(c); l = (*c)->ch[0] ? (*c)->ch[0]->s : 0; if (l <= k) { d1 = 0; } else if (l == k + 1) { return; } else { d1 = 1; k -= l + 1; } l = (*c)->ch[d1]->ch[0] ? (*c)->ch[d1]->ch[0]->s : 0; if (l <= k) { d2 = 0; } else if (l == k + 1) { s_rotate(c, d1); return; } else { d2 = 1; k -= l + 1; } cosplay(&(*c)->ch[d1]->ch[d2], k); if (d1 == d2) s_rotate(c, d1); else s_rotate(&(*c)->ch[d1], d2); s_rotate(c, d1); } ```
by jyi2ya @ 2019-06-16 20:49:05


上一页 | 下一页