Help required with simple DP Problem, WA on 47 testcase

Revision en1, by Ferrarixxx, 2020-05-22 17:35:26

Hi Guys,
I hope u are doing well

Actually
I cant understand why my code gives WA on 47 testcase
Even when my code is almost similar to the editorialist's code,

The testcase :
29 425 46 81
405 237 24 45 165 328 134 309 7 236 348 204 368 396 298 343 180 186 395 246 44 53 303 404 271 344 269 292 12

Actual answer : 2
Mycode's output : 1

Problem E Div 3 : https://codeforces.com/contest/1324/problem/E

My code Link : https://codeforces.com/contest/1324/submission/80940535

Editorial Link : https://codeforces.com/blog/entry/74714

Please give it a try.
Thanks in Advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Ferrarixxx 2020-05-22 17:35:26 695 Initial revision (published)