T1
T2
设 \(f(i)\) 表示 \([1,i]\) 被冻住,\((i,n]\) 未被冻住的最少次数。
则 \(f(i) = \begin{cases} f(i-1) + i & s_i = \texttt{0} \\ \min\limits_{j\in [i-2k-1,i)}\{f(j)\} + i-k & s_{i-k} = \texttt{1} \end{cases}\) 。
2024-03-27 21:56:16
设 \(f(i)\) 表示 \([1,i]\) 被冻住,\((i,n]\) 未被冻住的最少次数。
则 \(f(i) = \begin{cases} f(i-1) + i & s_i = \texttt{0} \\ \min\limits_{j\in [i-2k-1,i)}\{f(j)\} + i-k & s_{i-k} = \texttt{1} \end{cases}\) 。