Skip to content

Instantly share code, notes, and snippets.

@Kernelzero
Created June 4, 2021 09:15
Show Gist options
  • Save Kernelzero/e8ea1d09664f52a9f14586990cdff289 to your computer and use it in GitHub Desktop.
Save Kernelzero/e8ea1d09664f52a9f14586990cdff289 to your computer and use it in GitHub Desktop.
PRINT_VALUES = ['not cross', 'cross']
a, b = map(int, input().split())
c, d = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
# 두 선이 교차 하려면 a~b 사이에 c나 d가 하나만 포함되어야 한다.
bigger = a if a > b else b
smaller = a if a < b else b
cake = [0 for _ in range(1, 100 + 1, 1)]
cake[smaller:bigger] = [1 for _ in range(0, bigger-smaller)]
# cake = [1 for _ in range(smaller, bigger+1)]
# print(cake)
cake[c] = 0
cake[d] = 0
count = 0
for n in range(smaller, bigger):
if cake[n] == 0:
count += 1
val = PRINT_VALUES[1] if count == 1 else PRINT_VALUES[0]
print(val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment