Codeforces Round 642 (Div. 3) E. K-periodic Garland(DP+前缀和)
题目链接 https://codeforces.com/contest/1353/problem/E 思路 令 d p [ i ] [ 0 / 1 ] dp[i][0/1] dp[i][0/1]分别表示第 i i i个字符是 0 0 0或者 1 1 1时的前 i i i个字符组成的花环所需的最少操作次数。 如果第 i i i个字符变为 1 1 1,分为两种情况&#x…
2025-06-02