Hi I have been trying to solve REVORDER using python, as this is a shortening task hence I am trying to use various ways to solve this,but there are some problems that i am facing while trying to use a recursive approach:
def f(n):
if n == 0:
return
a = input()
f(n-1)
print a
f(input())
This works fine in ideone (http://ideone.com/MtQIu) but in the judge gives me NZEC.I asked the problem setter to have a look,but unfortunately he is not able to figure out the problem, he had sent me the error file :
Unfortunately, I don't know why You get NZEC. Everything seems ok.
If You want, that's the error which is displayed:
Traceback (most recent call last):
File "/sources/tested.py", line 8, in <module>
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
File "/sources/tested.py", line 5, in f
Does anybody know what is the problem ? I am very new to python hence I don't have much idea to interpret this result.
Regards,