The smaller subtasks, as I personally believe, implement a system of partial marking to encourage other people (of slower algo, a bit unrefined logic) to keep trying and improve further. (I mean, its better seeing that “Oh! I did the problem 30% but rest of cases are giving TLE…” . It kinda gives you a feel that you have done SOMETHING with your efforts and your efforts till now aren’t in vain.)
That said, its natural that they are a bit lenient. I mean, sometimes problem setters purposely give easy test cases in sub tasks of ~5,10 or 20 points so that people attempting with a bit of right logic GET something.
Don’t misinterpret it! What they do is that they give easier test cases (eg- little value of constraints ) so that codes, which are in right direction, get benefit of partial marking.
Your code was in right direction, but of course, you missed the “consecutively” part. I will call it leniency of problem setter rather than weak test case, cause as @bansal pointed out, they check their test cases and statement numerous time, and do not hesitate to correct it even if its up in the contest (I mean, I don’t encourage this practice cause problem once published in contest, should be free of errors, but it takes guts to accept the errors and correct it - knowing people will criticize you for not posting correct problem in first place)
That being said, the real show is in passing the final sub task of these problems, which sometimes make you pull your hair out on “MY PROGRAM PASSES FIRST 3 SUB TASK BUT WHY IS IT FAILING ONLY IN FINAL SUB TASK? AND WHY IS FINAL SUB TASK HAVING 75 MARKS WHILE FIRST 3 HAVE ONLY 25…”
(PS: . I guess that’s the reason final sub task has most weightage )
Please see- The above are my PERSONAL beliefs, purely based on my own experiences. I have no experience of setting problems or something, and what I said above is purely based on my experience in competitive programming as a contestant.