EOF error problem while taking input

Switch to the NON-IDE mode and copy your code their and submit it.
MAKE YOUR CODE IS WORKING IN OTHER IDE (LIKE PYCHARM OR ANY IDE OTHER THAN OF CODECHEF) .I was also stuck here and finally found the solution after 2 hours.


it dose’t work for me either

I know it’s very late but I am posting it, so that no one has to struggle to find a solution to this problem.
I have been searching a lot about this and i came across this solution:
You do not need to declare a variable for t as in
t = int(input())
for i in range(t):
#remaining code
Instead of this, just start your code with:
for i in range(int(input())):
#remaining code
This will not give EOFError, this is how they build this system.
Hope, This Helps.


I still have the same issue.
This is strange.

1 Like

t = int(input())
while t != 0:
# your code



try this

1 Like

i don’t know what is the issue with IDE mode but as what @prakx20501 said, " switching to non - IDE mode did the job for me.

If someone from @admin @admins reading this please provide the cause of issue and the solution to it.

1 Like

Have you provided custom input. I hope you know running without custom input will make your program work on empty input, not the example test cases.

1 Like

So its not like the other website (example : LeetCode ) ?
I mean there is no sample input, no auto initial test case that automatically run on you code and test it before final submission?

Cool. Problem solved. Thank you stranger for teaching me this about codechef .


That’s right :slight_smile: New to Codechef. Can't understand the platform - #3 by ssjgz

1 Like

For people using Python2, you can use:
T = int(raw_input())
instead of
T = int(input())

thank you …

This worked for me but what is the difference

1 Like

Thanks for the info. It helped me after scratching my head for a good hour.

Thanks Bro, this really helped

You can see this Actual Solution to understand much better about the problem and why my solution worked, though when i used it, it was just a hunch.

Could you tell me the answer if you overcame this EOF error.Thankyou.

Thank You. I submitted my first question on the November challenge.

I was also getting the same problem.
CodeChef Platform is a little bit different in taking inputs.
But, finally try & except solved my issue.

same problem man, have been stuck for hours now.
did you figure i out what to do?

i got also same problem e=because i forgot to write t=t-1
if you use while(t>0)
then at last t=t-1 use