WA on submission for correct code

Правка en1, от abhaysp, 2023-09-05 13:30:08

Hi,

I'm trying out problem 189A (https://codeforces.me/problemset/problem/189/A). I wrote simple DP (memoization) solution. Upon submission it's giving WA for test case 7


Input 10 3 4 5 Output 275861439 Answer 3 Checker Log wrong answer 1st words differ - expected: '3', found: '275861439'

When I run my code locally with the same failing test case, I get the correct answer. It happened one time before with test case 1 also. Locally, I got correct result, but on submission, it failed. Upon resubmitting with slight change in code (added reference operator '&' in parameter of recursive function, didn't changed the logic), the test case passed and now failing at test case 7.

Pls help in understanding why is this happening, so that I can avoid the mistake (if any) moving further.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский abhaysp 2023-09-05 13:32:17 124 added submission
en2 Английский abhaysp 2023-09-05 13:30:51 0 (published)
en1 Английский abhaysp 2023-09-05 13:30:08 869 Initial revision (saved to drafts)