QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: Milmon

Posted at:

Last updated:

Back to Problem

题解

从前往后每次贪心选取一个尽可能长的不同时包含 $1 \sim X$ 所有数的段令它们全相等即可。

时间复杂度为 $\mathcal{O}(N)$。

Comments

No comments yet.