[Solved] Help! Codeforces 580C Kefa and Park cannot pass test#20

Here is my recursion submission:

Submission #121257221 - Codeforces

It works until test#20, I reviewed the code several times already.

Any idea what is that 1 case that I don’t cover?

Thanks in advance!

I get the solution.

Submission #121262296 - Codeforces

I passed 0 to the rec() function regardless of the state of cat_q[]

Hey!!
I think our logic is quite similar :sweat_smile:
:blush:

1 Like

AC solution