New to Codechef. Can't understand the platform

Hi, I am new to codechef and I am trying to solve some easy level problem first but it seems
like I donot understand the platform well. I am good in Python 3 and have been doing great with my problem solving skill on Hackerrank platform . But ever since I logged to codechef I am always getting NZEC error or runtime error with my python code.

Also I am not able to comprehend the problem statement well I think as unlike hackerrank problem statement are not clearly explained here. Please help me.

4 Likes

Can you please the screenshot where did you get the error ?

One thing that trips up all people migrating from Hackerrank (hello :)) is that clicking “Run” (not “Submit”) here on Codechef does not run your code with the sample testcases - instead, it runs it with empty input (so attempts to read anything from stdin will fail, or give weird values). If you click “Run”, you must provide Custom Input.

22 Likes
NZEC error
Python EOF error on all the inputs
How to solve NZEC ERROR
Taking input Python
How to get rid of getting NZEC error while submitting solution in java?
Number Format Exception. NZEC runtime error
Getting run time error but AC on submition
EOF error problem while taking input.
Chef and Icecream Problem Code: CHFICRM
File "./prog.py", line 1, in <module> EOFError: EOF when reading a line
sigtstp error
SIGCONT Error on Life, the Universe and Everything
Custom Input runs
Runtime Error in RECNDNOS
Regarding error on non custom input
Runtime error / Exception in thread "main" java.util.NoSuchElementException
Getting SIGKILL and SIGCONT or WA error on LRNDSA01 >> Test Problem
NZEC error python
Sigsegv error__clean up problem
Problem in getting started
Python 3 code always results in Runtime error: NZEC
Getting SIGSTP Error on https://www.codechef.com/APRIL20B/problems/COVIDLQ/
TLE on Life, Universe and Everything
SIGCONT error?
Python NZEC Runtime Error
Runtime Error in HORSES
Getting SIGCONT runtime error while running "Life, The Universe, and Everything" problem
Why am i getting runtime SIGSEGV error even when my solution is right and has been aceped
EOF error problem while taking input.
Zero test cases
Why it is giving compile time error
PLease help. whenever I do any code it gives error during input but when i do it with same custom input i works fine
Help with submitting C# solutions
Java fast i/o issue with codechef
Exception:java.util.NoSuchElementException
JAVA NZEC runtime error always
Unable to submit CodeChef Hard Cash solution
Help me to fix the run time error (SIGSEGV) in my code
Train or walk
LECANDY - Editorial
I m new to coding , i got this error java.util.NoSuchElementException while i m executing help me why this error shows
SIGTSTP - Runtime error (BINADD)
Codechef IDE is horrible(for me atleast)
NZEC error in the code
I am getting NEZEC error
Segmentation error
Getting output 0 0
Why does it give Exceptions (MSV)
Error when running but no error on submission
WA in TOWIN
Unable to scan input in java . my code perfectly work on eclipse codechef complier can not scan input show error....i try both scanner and bufferedReader.... help plssss?
SIGCONT error
Runtime error when Run, But when submitted it gets Accepted
How to write python codes in codechef
Java Runtime error for using Integer.parseInt() , though proper updation of integer in loop
LECANDY - Editorial
When I run my code for first 2 time it says it SIGSEGV then for 3rd time it says SIGEMT and for 4th time it says SIGTSTP and then 5th time time it gives correct response please explain why this is happening?
Please help with this error! Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:862) at java.util.Scanner.next(Scanner.java:1371) at Codechef.main(Main.java:13)

Ha! Even I tripped on that the first time. :crazy_face:

1 Like

I think I spent about 10 minutes clicking Run and looking at my debug output and scratching my head the first time XD

9 Likes

1 Like

did you press run?
That might explain why you got NZEC because you didn’t give any sample input

Read this post, it may help.

@gauraws import functools. Map is now in functools. This was done because GVR figured since coders can just do [func(x) for x in iterable] , map needn’t be a builtin function

This problem occurs because you didn’t provide the inputs to your code.
So please click on Custom Input checkbox and then provide input, what you want then click on run.
Now you will good to go ; )

1 Like

My code works fine with custom input(same input as in the problem description) but when I submit it says “Wrong answer”.Need help.

#Code
def uni():
global uniprob
for i in list:
if(i.prob_num<9):
uniprob.append(i.prob_num)
uniprob = set(uniprob)
class Test:
def init(self):
self.prob_num,self.score=(int(input()),int(input()))

Taking test case and submissions

try:

tcase = input()
tcase = int(tcase)
for _ in range(tcase):
    uniprob =[]
    list=[]
    submis = int(input())

Creating a list of objects

    for i in range(submis):
        list.append(Test())

Global Scope

    uni()
    k=0
    maxm=0
    finalres=0

    for k in uniprob:
        for i in list:
            if i.score>maxm and i.prob_num==k:
                maxm = i.score
        finalres = finalres+maxm
        maxm=0
    print(finalres)

except:
pass

Even me when I came from Hackerearth :sweat_smile:

3 Likes

gosh! that was it lol. I havent competed since 2012…feel so stupid

1 Like

Hi,I am using python 3.6 lang, I clicked on custom input and it work fine when i click on run but the problem is coming when I am clicking on Submit Button it is always showing wrong answer.
while i have checked for solutions in other language and my solution is correct what to do?

https://www.codechef.com/viewsolution/32286114
Corrected it. Your code may sometimes print yes multiple times, so you also need to check that flag!=1. Also you were not resetting flag after each test case.

Hi thank u so much :hugs:.

Use try: and except: for python. It works for me.
For example:
try:
for t in range(int(input()):
n = int(input())
print(n)
except:
pass

if you want to test your code, give sample input and then click “RUN”. if you want to submit code, you just click “submit” button. NZEC error occurs when we click “RUN” without giving input

welcome to maturity.

Hi, I am actually new to codechef platform. Could you help me in overcoming error like
“Traceback (most recent call last):
File “./prog.py”, line 5, in
EOFError: EOF when reading a line”.
However, I ran the program with custom input.But, I couldn’t manage it while submitting. Could you please help me with this.Thankyou