This is the final code which clears all test cases.
T = int(input())
for i in range(1,T+1):
N=int(input())
jobs=[]
for x in range(N):
jobs.append(tuple(map(int, input().split(' ')))+(x,))
L = [0]*N
cj=[0,0]
m = sorted(jobs)
imp = False
for j in m:
So I think I have found out the reason for RE. *I didn't consider fully
overlapping job intervals*. Due to this when a fully overlapping interval
is in the test set, the dictionary just updates to a new value with the key
remaining same. In this case first (1,10) points to the value 0 then it
You can try the following test case
*1*
*2*
*1 10*
*1 10*
Expected output
*Case #1: CJ* (or *JC*)
--
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