Trisq nzec python

I always get stuck solving problem in python because of NZEC error kindly have a look at my problem solution for problem TRISQ.
Also please suggest some tips regarding solving such errors while programming in python. Thanks in Advance!

It’s because of the recursion stack overflowing.For large inputs like 10000 your solution exceeds the maximum recursion limit.Try avoiding recursion as much as possible and instead use for loops.
For this question simply use
n=int(raw_input())
b=n/2
print b*(b-1)/2

1 Like

Any more suggestions for debugging NZEC errors in python.

try this - https://discuss.codechef.com/questions/72153/tutorial-how-to-debug-an-nzec-error
and search nzec error tag it’ll help u a lot

thanks man!

NZEC - Non Zero Exit error.

In python it can happen when you are trying to input a list of numbers , we generally do like this

num = [int(i) for i in raw_input().split(’’)]

This can lead to nzec if there is an additional space towards the end, problem testers dont test their solutions in python, i have faced problems on NZEC before.