QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: nullptr_qwq

Posted at:

Last updated:

Back to Problem

New Editorial for Problem #25306

$O(2^nn^3)$ 是平凡的

转移是对一堆东西 chkmax 而值域很小所以可以从大到小排序后变成覆盖,这样一轮的转移均摊 $O(n)$。使用位运算记录已经转移过的点,每次和邻边取交即可找出要转移的位置

可以优化到 $O(2^nn^2)$,注意实现上常数。空间问题可以用 uint8_t 存。

Comments

No comments yet.