Untitled
unknown
plain_text
a year ago
972 B
14
Indexable
conflictflag = False
course = [[] for _ in range(3)]
for i in range(3):
lesson1 = int(input())
timea = int(input())
timeb = int(input())
course[i].append(lesson1)
course[i].append(timea)
course[i].append(timeb)
course.sort()
def check():
global conflictflag
answerset = []
for i in range(3):
for j in range(i + 1, 3):
for time1 in course[i][1:]:
for time2 in course[j][1:]:
if time1 == time2:
conflictflag = True
answer1 = course[i][0]
answer2 = course[j][0]
answerset.append((min(answer1, answer2), max(answer1, answer2), time1))
answerset.sort(key=lambda x: x[2])
for answer in answerset:
print("{} and {} conflict on {}".format(answer[0], answer[1], answer[2]))
check()
if not conflictflag:
print("correct")Editor is loading...
Leave a Comment