Help with greedy problem

Правка en1, от aakarshmadhavan, 2018-07-02 02:14:50

Hello,

I find myself very bad at greedy-algorithms and greedy-problems. I have found an easy problem online I have not been succesful myself in solving:

Problem

I am not confident in how to get to this problem.

My current idea is to sort the array according to height, and if height is equal then according to k. But I am not sure where to go on from here. Any help is appreciated greatly.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aakarshmadhavan 2018-07-02 02:14:50 464 Initial revision (published)