TommasoUlian's blog

By TommasoUlian, history, 3 months ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by TommasoUlian (previous revision, new revision, compare).

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by TommasoUlian (previous revision, new revision, compare).