## 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.

Author: FatalEagle

Knowledge required: simple logic

This problem asks whether two given video clips overlap. In other words, it cares if for any constant .

solve :: [Integer] -> String
solve [a,b,c,d] | a > c = solve [c,d,a,b]
solve [a,b,c,d] | b > c = "YES"
solve [a,b,c,d] = "NO"
main = interact \$ solve . (map read) . lines


Time Complexity:

Bonus: How would you solve this problem if there were video clips?

## Comments

• commented on July 21, 2019, 1:55 p.m.

That is Haskell.

• commented on July 21, 2019, 7:59 a.m.

What language is this?