当前位置 博文首页 > sky123博客:2020ICPC小米网络赛第二场 A.2020
题目链接
题目描述
Bobo has a string
s
1
…
s
n
s_1 \dots s_n
s1?…sn? of length
n
n
n consisting of only digits
0
,
1
0, 1
0,1, and
2
2
2, and he wants to pick some disjoint subsequences which equal to
2020
2020
2020, as many as possible.
Formally, Bobo would like to find k k k quadrangle ( a 1 , b 1 , c 1 , d 1 ) , … , ( a k , b k , c k , d k ) (a_1, b_1, c_1, d_1), \dots, (a_k, b_k, c_k, d_k) (a1?,b1?,c1?,d1?),…,(ak?,bk?,ck?,dk?) where
Find the maximum value of k k