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/f0837f9a-5d6b-4e97-b546-07bb2d0c3e82%40googlegroups.com.