ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1203. Scientific Conference

How can I sort in this problem?
Posted by K-A-R-E-N 14 Jan 2009 19:34
Can anybody help me??? Please...
Re: How can I sort in this problem?
Posted by rihaz 4 Sep 2014 19:33
i think this problem can be solved using greedy algo too,
sort them according to the ending time, take a time variable 't',we took the interval whose starting time is later than 't' and choose the one which ends the earliest.

for example: 1-4 4-14 6-10 3-7 11-16
sorted: 1-4 3-7 6-10 4-14 11-16
here 1-4 ends the earliest, then we have a choose 6-10 (as 3-7 starting time is before 4)
....
i think you get the idea.