of length n consisting of only digits 0, 1, and 2, and he wants to pick some *disjoint* subsequences which equal to 2020, as many as possible.
Bobo has a string
s_1 dots s_n
s
1
…s
n
of length n consisting of only digits 0, 1, and 2, and he wants to pick some *disjoint* subsequences which equal to 2020, as many as possible.
Formally, Bobo would like to find k quadrangle
(a_1, b_1, c_1, d_1), dots, (a_k, b_k, c_k, d_k)
(a
1
,b
1
,c
1
,d
1
),…,(a
k
,b
k
,c
k
,d
k
) where
*
1 leq a_i < b_i < c_i < d_i leq n
1≤a
i
标签: HBC2131282020题解