BIGOF02-Editorial

Problem Link :

Contest
Practice

Author: Amrutansu Garanaik , Abhishek Patnaik

Tester: Keshow Sablaka, Amit Das

Editorialist: Amrutansu Garanaik , Amit Kumar Sahu

Difficulty :

easy

Pre-requisite greedy algorithm, activity selection algorithm ## Problem : Given a set of events with their starting and ending time, what is the maximum number of non-overlapping events we can get.

Explanation

This is a standard problem known as Activity Selection Problem, which can be solved using
Greedy algorithm. First we need to sort the the times based on the ending time. Then first event is
selected. Then all successive events are checked and an event is selected if its start time is greater
than the ending time of the previously selected event. The total number of selected events is the
required answer.

Setter solution

Terima kasih dan salam kenal.
codechef Link

code Link