Greedy vs DP

Правка en2, от canvas_melody, 2025-01-05 10:09:56

I sometimes get confused when to use greedy and when to use DP. I have this problem — https://mirror.codeforces.com/contest/455/problem/A where I thought my solution which is greedy would be correct but it went wrong on a 100 element array when submitted. I don't seem to find any mistake or failing test case for my solution. Can someone help?

My Solution
Теги greedy, dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский canvas_melody 2025-01-05 10:10:33 770
en2 Английский canvas_melody 2025-01-05 10:09:56 102
en1 Английский canvas_melody 2025-01-05 10:09:20 1234 Initial revision (published)