Why do I get an NZEC?

CodeChef is officially broken!.
They can’t fix there own mess! :sneezing_face::sneezing_face:

and btw, raw_input() doesnt work in python3 its for python2!

i keep on getting nzec error in all my programs i do copied a right solution but i am still getting same error, So please help me , Thankyou in advance.
here is the link of my code

I am facing the same issue for the python program.
The Question link is: https://www.codechef.com/problems/CSUB
Please help me on how to solve this error.

for i in range(0,t):

for i in range(0,t):
        if v[i]%10==1:
    ans= ((counter*(counter+1))//2)        
    print (ans)

Error I am getting

Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
EOFError: EOF when reading a line
1 Like

https://www.codechef.com/viewsolution/24356597 here is my code in python showing nzec error while submission . but it runs successfully with custom inputs ,why so?

1 Like

Dont know the reason but appently many python programmers are facing this issue
I would suggest switch to c++ or java

You need to come up with a better approach to solve it. The constraints on L and R are 1018. So recursion won’t work be it Python, C++ or Java.

For python 3 do I need to use raw_input() as well ?

NZEC error still unresolved. and the biggest problem is that you can’t check the output of your submission. I changed all reference of ‘input()’ (Python 3.6 code) to ‘sys.stdin.readline()’ but still the code is not working properly after submission. Works just fine for custom input. https://www.codechef.com/viewsolution/25205676

No , python 3 doesn’t even support that.
and don’t worry about white spaces as int(input()) will take care of that.

The thing is always assign your variable in global by assigning None to them. (this was my case once)

But still on clicking the submit button it shows nzec error

getting NZEC for my code ,in python`https://www.codechef.com/submit/FLOW001]

This might be helpful to someone. I used Java and it gave me NZEC. Even after removing all the functions and just taking input, it was giving me the same error. Finally, I decided to just comment all lines and add one line at a time to check which line was giving me error.

It was: int[][] arr = new int[n][n]

Here, n can go up to 314159.

When I gave the same number in my local system and executed, it gave me:
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space

I was trying to allocate memory for a very big matrix(n^2). This was a mistake I never thought I would make. This is so basic and might help who are struggling with it.

1 Like

It’s still not working for me !
here’s my code :

for z in range(T) :
a=list(map(lambda x:int(x),a))
for i in range(len(a)) :
for m in range(0,i) :
if int(a[m]) % int(a[i])==0 :
it shows NZEC error in the first line itself

If you’re using Codechef IDE, you need to provide a custom input, or it won’t work. To submit the code, switch to non-IDE mode and then Submit.

1 Like

Can Any one tell me why i am always getting NZEC for my java code ??

Why am I getting this error on python3.6?

1 Like

For python…

  1. if input demands accepting more than 1 input in a single line.

Then this won’t work…
p = int(input())
q = int(input())

Instead try,
p,q = map(int, input().strip().split())

  1. If code runs on your computer and problem is just while submitting.

Provide custom input in codechef ide or directly submit. Then it wont show NZEC.

import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
	public static void main (String[] args) throws java.lang.Exception
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int cases=Integer.parseInt(br.readLine());
		for(int i=1;i<=cases;i++){
		    int n=Integer.parseInt(br.readLine());
		    int[] series=new int[n];
		    for(int j=2;j<n;j++){
		    for(int j=0;j<n;j++){
		        int[] derived=new int[series.length/2];
		        int c=0;
		        for(int k=1;k<series.length;k+=2){
		        series=new int[derived.length];
		        System.arraycopy(derived, 0, series, 0, derived.length);

When I am running this code, it runs absolutely fine. But, it shows a NZEC while submitting. Why?

What Problem are you trying to solve? :slight_smile:

I am trying to solve this https://www.codechef.com/problems/FIBEASY

1 Like