[Help]What is the idea behind this greedy approach?

Правка en1, от fischerman, 2021-05-28 15:34:18

Problem link — https://codedrills.io/contests/amrita-icpc-practice-session-7/problems/alibaba-and-thieves There is an editorial, but it just describes the algorithm instead of the idea (or I just don't get it). Can anyone please describe why is this correct? Also, if there are more problems where we need to sort some intervals and do something greedily, please share.

Теги #help, #greedy, #algorithms, #sorting

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский fischerman 2021-05-28 15:34:18 428 Initial revision (published)