Please subscribe to the official Codeforces channel in Telegram via the link ×

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

Revision en1, by fischerman, 2021-05-28 15:34:18

Problem link — 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


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