I tried it on my Local machine but , showed a runtime error when I
Submitted it.
Here is my code,
def valid(person, task):
for taskCheck in person:
if task[0] in range(taskCheck[0], taskCheck[1]) or task[1] in
range(taskCheck[0], taskCheck[1]):
return False
return True
def fun():
jamie = []
cameron = []
ans = ''
taskCount = int(input())
for i in range(taskCount):
lst = (list(map(int, input().split(" "))))
if valid(cameron, lst):
cameron.append(lst)
ans += 'C'
elif valid(jamie, lst):
ans += 'J'
jamie.append(lst)
else:
ans = "IMPOSSIBLE"
break
return ans
n = int(input())
anslst = []
for i in range(n):
anslst.append(fun())
j = 1
for i in anslst:
print("Case #" + str(j) + ": ", end="")
print(i)
j += 1
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/7e468dac-5d1f-44c8-983d-1b355b316d4f%40googlegroups.com.