OIer_Automation's blog

Blogs

求助复杂度分析

2025-03-30 15:11:22 By OIer_Automation

有一个长度为 $n$ 的序列 $a$,现在有一个针对序列 $a$ 的算法。我们设集合 $S_r=\{\text{mex}(l,r)|1\le l\le r\}$,其中 $\text{mex}$ 是区间中最小的没有出现过的自然数,那么这个算法的复杂度为 $\sum_{1\le r\le n}|S_r|$,询问这个算法复杂度的级别,或者换句话说,我们可以将这个算法卡到什么程度?

Comments

Euphoria_
平方级别,考虑从中点处往前放 0,1,2,... 即可
  • 2025-03-31 14:00:21
  • Reply

Post a comment

You can refer to mike by using "@mike", and "mike" will be highlighted. If you want to type the character "@", please use "@@" instead.

You can enter "/kel" to use the emoticon "kel".