Please tell me why I got runtime error while solving a problem with DFS even I set recursion limit also but I don't know why I got runtime error. Check my solution please. https://mirror.codeforces.com/contest/843/submission/131610110 https://mirror.codeforces.com/problemset/submission/884/131576407 Thanks
Auto comment: topic has been updated by Ayushman_123 (previous revision, new revision, compare).
You're using
setrecursionlimit
to increase the height of the stack but what you need is to increase the overall size of the stack, which can be easily be done using thethreading module
. Your modified submission in python for one of your problem. Hope this helps you.it's really very helpful but don't you think 10**8 tends to memory limit exceeded sometimes ? Thank you so much for that modified code.
True, that's why you should consider using python3 until codeforces starts supporting 64-bit version of pypy3
ohhh I got it now thank you so much