Skip to content

[testcase] Hack a wrong implementation of Li Chao Tree.#1383

Merged
maspypy merged 1 commit into
yosupo06:masterfrom
a1fredbao:master
Feb 2, 2026
Merged

[testcase] Hack a wrong implementation of Li Chao Tree.#1383
maspypy merged 1 commit into
yosupo06:masterfrom
a1fredbao:master

Conversation

@a1fredbao
Copy link
Copy Markdown
Contributor

@a1fredbao a1fredbao commented Feb 1, 2026

As described in the title, there are some Chinese CP candidates who implement a kind of Li Chao tree that doesn't swap functions on the nodes when performing insert.

However, this can be hacked by inserting $y = \lfloor \frac{l + r}{2} \rfloor$ for $[l, r]$ and a lot of $y = x$. In this situation all the nodes on the tree will be traversed when inserting $y = x$, which can lead to a wrong time complexity of $O(nq)$.

QOJ has also added such hack.

@maspypy
Copy link
Copy Markdown
Collaborator

maspypy commented Feb 2, 2026

Thank you

@maspypy maspypy merged commit 4791835 into yosupo06:master Feb 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants