Runtime Error Bug in System Testing

Revision en3, by TommasoUlian, 2024-04-21 21:43:19

I'm sorry to complain, but I've just seen the results of system testing in Codeforces Round 940 (Div. 2) and CodeCraft-23 and my submission on problem C received a runtime error on test 33. I think the problem is related to the return statement in the void solve() function because after the contest I've tried submitting the same code but just removing the return and using if else. I link here the two solutions :

I don't really care that much about rating and I'm not here to ask for a re-judgment, but I'm really curious about what could be causing this, so I don't make the same mistake in the future.

UPDATE:

I found the problem, int the first part i'm accessing dp[1] and dp[2] but dp[2] is out of bounds for n = 1.

It's still strange to me how adding return in the function got accepted.

Sorry.

Tags runtime error, bug

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English TommasoUlian 2024-04-21 21:43:19 209
en2 English TommasoUlian 2024-04-21 21:16:20 12
en1 English TommasoUlian 2024-04-21 21:11:02 734 Initial revision (published)