当前位置 博文首页 > sky123博客:2020ICPC小米网络赛第二场 A.2020

    sky123博客:2020ICPC小米网络赛第二场 A.2020

    作者:[db:作者] 时间:2021-09-21 15:15

    题目链接

    题目描述
    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

    • 1 ≤ a i < b i < c i < d i ≤ n 1 \leq a_i < b_i < c_i < d_i \leq n 1ai?<bi?<ci?<di?n
    • s a i s b i s c i s d i = 2020 s_{a_i} s_{b_i} s_{c_i} s_{d_i} = 2020 sai??sbi??sci??sdi??=2020
    • { a i , b i , c i , d i } ∩ { a j , b j , c j , d j } = ? \{a_i, b_i, c_i, d_i\} \cap \{a_j, b_j, c_j, d_j\} = \emptyset {ai?,bi?,ci?,di?}{aj?,bj?,cj?,dj?}=? for i ≠ j i \neq j i?=j

    Find the maximum value of k k