Same code - AC in C++, RE in Python

In this quite easy problem CCARRAY, I just implemented what was asked and, (whoa!) Runtime Error. However the same code when written in C++ gives AC
Python 3.6 - RE
C++ - AC
Interestingly, there are no AC submissions for this problem (refer here)
Could someone point if I am missing something or something else is going wrong over here?
@suman_18733097 @ssjgz @admin

Possibly wrongly formatted test data. It’s an external contest, so please ask that organizer.

2 Likes

Ok thanks
but it’s too much of a pain to do that for an external unrated contest (with no prizes).

You can overcome some input format issues using a little generator function to give back one input value at a time, as I mention in this comment :

def getvals():
    while True:
        yield from input().split()

inp = getvals() # iterator delivering input
T = int(next(inp))

etc.

2 Likes

Thanks :slightly_smiling_face: