Help in DP Problem 4D

Правка en1, от ritik_patel05, 2020-03-18 11:42:59

Problem: https://mirror.codeforces.com/contest/4/problem/D

Solution: https://mirror.codeforces.com/contest/4/submission/73546246

What I am doing is first sorting indexes with given height and width in increasing order. Then I am making a recursive function to calculate longest chain. Whenever I reach an index, I have 2 options either include or don't include it.

I have been trying to find for long why am I getting the wrong answer. But I have no clue.

It would be great if someone could point out my error in thinking.

Thank you :)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ritik_patel05 2020-03-18 11:42:59 565 Initial revision (published)