Can you please explain why my solution timed out for the second subtask? I used the same method described in the editorial:
I even submitted a DP solution with precalculated values:
This was a contest solution, it affects my score.
I have tested I/O speed on the Enormous Input Test problem:
Both of them were accepted, the Console.WriteLine(count) version is little bit faster. How was I supposed to know my output is not fast enough?