Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- soucet=0
- with open("input.txt") as file:
- for line in file:
- s11,s12,s21,s22 = [int(x) for _ in line.split(",") for x in _.split("-")]
- if (s11<=s21 and s12>=s22) or (s21<=s11 and s22>=s12):
- soucet+=1
- print(soucet)
- ###########################################################################################
- soucet=0
- with open("input.txt") as file:
- for line in file:
- s11,s12,s21,s22 = [int(x) for _ in line.split(",") for x in _.split("-")]
- for i in range(s11,s12+1):
- if i in range(s21,s22+1):
- soucet+=1
- break
- print(soucet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement