Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

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

Revision en1, by 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.

Tags #help, #greedy, #algorithms, #sorting

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English fischerman 2021-05-28 15:34:18 428 Initial revision (published)