in the else statement, i have marked it down. If the case doesn't belong to
neither J nor C, then it executes ELSE statement, there i was checking the
overlapping cases
On Wednesday, April 8, 2020 at 2:29:45 AM UTC+5:30, divyansh srivastava
wrote:
>
> Bro how are u checking overlapping cases in this??
>
> On Tuesday, April 7, 2020 at 10:44:44 PM UTC+5:30, PAGADALA SAINADTH wrote:
>>
>> I do. you check it here
>> te = int(input())
>> for i in range(te):
>> print("Case #"+str(i+1)+": ")
>> term = False
>> l = []
>> n = int(input())
>> for i in range(n):
>> l.append([int(x) for x in input().split(" ")])
>> l[i].append(i)
>>
>> m = l.copy()
>> m.sort()
>> J = 0
>> C = 0
>> ans = []
>> for i in range(n):
>> ans.append('0')
>> for i in range(len(m)):
>> if(J <= m[i][0]):
>> J = m[i][1]
>> ans[m[i][2]] = 'C'
>> elif(C <= m[i][0]):
>> C = m[i][1]
>> ans[m[i][2]] = 'J'
>> else:
>> term = True
>> print("IMPOSSIBLE")
>> break
>> if(not term):
>> print("".join(ans))
>>
>>
>>
>> On Tuesday, April 7, 2020 at 6:20:28 AM UTC+5:30, Martin Seeler wrote:
>>>
>>> I'm asking to keep my sanity: Did anyone solve this problem with Python?
>>> I can't find these tricky edge cases where my code fails, all variations
>>> I try on my machine seem to work just fine. Still CodeJam Environment says
>>> *WA*.
>>>
>>> If there is someone who solved it in python, then I know I'm missing
>>> some cases. Otherwise I start to question the environment :D
>>>
>>> Thanks and have a nice day everyone
>>>
>>
--
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/3ed54dfd-c122-47fa-8d12-8dab03a99842%40googlegroups.com.