NZEC = Non Zero Exit Code, i.e. termination of your program is caused by a runtime error.
There are some reasons for that:
- accessing an unvalid list index
- using a non-existing dictionary key
- division by zero or other mathematical erros
- missing imports
- using undefined variables
- etc.
According to QTREE:
If you look at the submissions, you can see the following:
There are more than 300 AC submissions until now, so it seems it isn't one of the very hard problems (or there exists a solution in the web ...).
If you look at the timelimit and the runtimes of the AC submissions you can see, that the fastest solutions in fast languages are about 1 s of runtime with a limit of 5 sec. Though I didn't try, I'm quite sure it won't be possible using python. You should try some other problems.
Nearly all problems with AC submissions < 0.03 s in fast languages you can solve with python. Good luck.