NZEC in Spoj COMDIV. Please help me fix it

This post was flagged by the community and is temporarily hidden.

1 Like

I code in C++. So, I can’t tell you whats wrong with your code but I can tell you about NZEC error (Common in C++/Java)

Why do I get an NZEC?
NZEC stands for Non Zero Exit Code. Usually this error occurs when the code returns a non-zero value from main() function or if you omit an return 0; from the code. Other languages like Java/C++ could generate this error if they throw an exception which was not caught (e.g. Trying to allocate too much memory in a vector).

So for Java : NZEC will usually mean that your program either crashed or raised an uncaught exception.

Happy Coding :slight_smile:

@amitt001 Yes it was an ArrayIndexOutOfBounds Exception. thanks :slight_smile: I have added an update to the post. please let me know if you have anything else to suggest regarding the TLE.