Counting Perfect Subsequences

  • + 2 comments

    My algorithm works with case 1 and simple cases found here in the discussion, where we can check by hand, but it fails with the test cases. For case 2, the solutions are: 67529287 67529287 441870358 916664717 834126565

    mine are: 239514543 239514543 865533985 125267162 652571787 Besides reading the editorial, is there another way to check?

    Example, these are some results for my algorithm:

    • aaaaaaaaaabbbbbbbbbb 184755
    • aaaaaaaaaabbbbbbbbbbcd 369511
    • aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd 134779297 (this also uses the mod)