Editorial for LCC/Moose '19 Contest 1 S1 - Travel Conflicts


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: Riolku

Thankfully this problem doesn't force you to deal with fancy leap years such as 2000, since the date is in the future (October 2019) and less than 2030.

Although you can use some addition and overflow the month and the like, you are most likely best off using a dedicated date & time module. The python equivalent is datetime. Once you have the four dates, A B C D, the dates do not overlap if and only if:

\displaystyle  (B \le C)\ \text{or}\ (D \le A)


Comments

There are no comments at the moment.