ABC070 B: Two Switches

B - Two Switches

解き方

区間[A:B][C:D]の重複区間を求める。[max(A, C):min(B, D)]

github.com