I am just a rookie programmer.I am getting NZEC error E0F in python 3.6
while taking input but it works fine for custom input and in my IDE
It goes like this
thanks in advance.
It will be more helpful if you send the code and some sample inputs, because there might be some errors in your code
oops i forgot about the contest ongoing. Thanks for reminding.
for j in range(t):
for i in range(d):
for i in range(d-1):
if s[i]==“A” and i>2 and i<=d-3:
if (s[i-2:i]==“PP”) and (s[i+1]==“P” or s[i+2]==“P”):
Firstly, am assuming that you have marked the identations correctly.
I did not find any NZEC error in your code
But it will provide you a WA because in the problem it is clearly mentioned that in d-1 or in d-2 at least in one day Chef should be present but you are checking for both, so similarly there should also be a change in checking of ith position of the string after the 2nd inner loop(i>=2)
You are updating variable c after every check and also n . (Think about that)
you should add up the number of days in which you can mark him present to initial once not after every calculation of the increment.
Lastly, when you are printing -1 at last, you are breaking out of the test case loop, which will terminate the test cases succeeding any negative response case.
i was getting one when i was runnning it on ide bcz i was not aware that we need to provide custom input in that case.So sorry and thanks.And about c, i am checking when it crosses the 75 mark so that i dont need to check for minm later but thanks for help and suugestions @deadshot_sb
@ut3698 I guess these were the only mistakes and yes that’s a problem for Java and python users when given no input results in a runtime error.