Editorial for DMOPC '15 Contest 3 P1 - Quality Scenes
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Consider sorting the video clips and, subsequently, their endpoints,
If
Now, we can check if the endpoint of the leftmost video clip (starts at
If the start of the rightmost video clip (YES
; otherwise, output NO
.
Time Complexity:
Bonus: How would you solve this problem if there were
Comments