728x90
반응형
11970번: Fence Painting
Several seasons of hot summers and cold winters have taken their toll on Farmer John's fence, and he decides it is time to repaint it, along with the help of his favorite cow, Bessie. Unfortunately, while Bessie is actually remarkably proficient at paintin
www.acmicpc.net
fs, fl = map(int, input().split())
cs, cl= map(int, input().split())
#if not overlapping
if cs>=fl or cl<=fs:
print( fl-fs + cl-cs)
else:
print( max(fl,cl) - min(fs,cs) )
728x90
반응형
'Algorithm Problems' 카테고리의 다른 글
[백준] 1157 .py - 단어 공부 (0) | 2021.01.15 |
---|---|
[백준] 2231 .py - 분해합 (0) | 2021.01.15 |
[백준] 2884 .py - 알람시계 (0) | 2021.01.15 |
[백준] 9020 .py - 골드바흐의 추측 (0) | 2021.01.15 |
[백준] 11971.py - 속도위반 (USACO Bronze) (0) | 2021.01.15 |