Code running perfectly on eclipse and command line but throws run time error(NZEC)


I am new to codechef. I am trying to solve a problem. the solution is working fine on my system(eclipse)but shows runtime error(NZEC) on codechef. Trying to solve FarmerFeb april contest.

This link might be helpful for you Codechef FAQ

1 Like

Read some of the practice problem solutions in whatever language you are doing your program. You may have problems in input and output.


thanks vikas and bharath. I checked the FAQ it helped me get to know many things but it didn’t solve my NZEC problem. I also saw few practice problems. even that didn’t help out. I got wrong answer as the result of submission yesterday. When I tried to execute same code today it is giving me NZEC error instead of wrong answer. I don’t understand this.

bro i suggest to try it in C or C++. do very basic coding. even memset() of C++ not allowed here sometimes(i myself experienced it last month).

In which programming language are you programming? I see WA for your Java submission, TCL and JAR gets NZEC…

I am programming in java .Since i was getting a NZEC in java i tried to export the program to a jar file and try… but even with jar i was getting the same issue. I don’t know TCL i might have by mistake pasted the java code in TCL and submitted.

Apply try-catch to parts of your code and then try to figure out which part of the code gives you NZEC. Or else one more thing can be done. Write a random input generator and check your code for those random inputs considering the constraints in the problem.

thanks for the suggestion garakchy. I will give a try.

1 Like

i tried random inputs on my system and its working fine. regarding try catch i will try that and get back. BTW thanks. :slight_smile: