Getting NZEC in code submitted in python, while same thing written in C++ got AC. Can anyone figure out please what is the problem with python on codechef ide?
It’s working on offline ide.
CodeChef: Practical coding for everyone. Link for python code.
CodeChef: Practical coding for everyone. Link for C++ code.
TRISQ Problem - CodeChef. Link for the problem.
@l_returns
1 Like
RecursionError: maximum recursion depth exceeded in comparison
You have to give costum recurssive limit
here is your accepted code
Solution
import sys
sys.setrecursionlimit(150000)
def fun(n):
if(n<3):
return 0
return fun(n-2)+(n//2)-1
for _ in range(int(input())):
n=int(input())
print(fun(n))
for more have a look at
1 Like
Thanks a lot bro…
1 Like