Блог пользователя depressed_ontop

Автор depressed_ontop, история, 3 года назад, По-английски

I am getting run-time error most of the time in python in problems involving trees. I have increased recursion limit then also I am getting run-time error .And same logic works in C++.

Some of my recent submissions 119637795,119420809 and there are many more .

I want help, Is there any way of doing DFS in python without getting run-time error.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

I don't think there is any solution for this "problem". instead one should get comfortable in c++ programming.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    The solution is wrapped into a function. This function is run in a new thread. Before that, the stack limit for new threads is updated.

    The trick of starting a new thread to control the stack size in the contests is old. I first saw it used for Java some time around 2010. 119420809 Now it is accepted. I got the solution thanks to Gassa