Python can't handle deep recursion even after setting the recursion limit

Revision en1, by Moody_in_a_hoodie, 2020-07-14 23:00:15

for context: problem link : https://codeforces.net/contest/580/problem/C my solution :https://codeforces.net/contest/580/submission/86856021 Got RE in 35th case the python AC submissions for this problem are executed using bfs. I looked at some AC submissions in c++. looks like the logic is same. So the problem is I guess is with python.

lets say I avoid recursive implementation and go for iterative ones..for example Bfs over dfs. but is it even possible in all cases? And also if you can provide a feasible way to execute deep recursions without runtime error I will be extremely grateful.

Please don't suggest to learn C++ right now. I know it is a great language. But I just can't afford the time now. I am currently working on learning new skills that will help me in web dev. I hope you understand my position.

Tags #recursion, #python3, #dfs and similar, #graph theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Moody_in_a_hoodie 2020-07-14 23:31:10 7 Tiny change: '6856021)\nGot RE i' -> '6856021)\n\nGot RE i'
en3 English Moody_in_a_hoodie 2020-07-14 23:30:07 31
en2 English Moody_in_a_hoodie 2020-07-14 23:15:56 4 Tiny change: 'e problem is I guess i' -> 'e problem I guess i'
en1 English Moody_in_a_hoodie 2020-07-14 23:00:15 931 Initial revision (published)