Codeforces и Polygon могут быть недоступны в период с 6 декабря, 22:00 (МСК) по 7 декабря, 00:00 (МСК) в связи с проведением технических работ. ×

2 similar approach getting different result?

Правка en1, от KIMJONGOOF, 2024-10-21 12:36:22

This is the question. https://codeforces.net/contest/1974/problem/E

AC submission -> https://codeforces.net/contest/1974/submission/287177874

WA submission -> https://codeforces.net/contest/1974/submission/287176403

In both my submissions, i have the exact same approach, only diff being in 1 case i use the current dp state to update the next dp states(in the WA submission) and in the AC submission i use previous dp states to update current dp states.

Where am i going wrong?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский KIMJONGOOF 2024-10-21 15:11:16 39 Tiny change: 'g wrong? ' -> 'g wrong? \n\n*Edit -> Resolved'
en1 Английский KIMJONGOOF 2024-10-21 12:36:22 539 Initial revision (published)