Why do I get an NZEC?

provide link to the question also

1 Like

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

map(int,raw_input().split())

or

map(int,raw_input().split(' '))

Both are correct :stuck_out_tongue:

It might be because you have referred to out of bound index array (that ie, referring to index > len(array). I also got this error on first try :stuck_out_tongue:

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
https://www.codechef.com/submit/HMAPPY2

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.

t=input()
t=int(t)
i,counter,l,v=0,0,list(range(0,t)),list(range(0,t))
for i in range(0,t):
    l[i]=int(input())
    v[i]=int(input())

for i in range(0,t):
    counter=0
    while(v[i]>0):
        if v[i]%10==1:
            counter+=1
        v[i]=v[i]//10
        #print(v[i])
    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 ?