A_Bored_Dog's blog

By A_Bored_Dog, 3 weeks ago, In English

Hello Codeforces community,

I've been focusing on solving problems related to trees and depth-first search (DFS) recently. However, I've encountered a recurring issue when submitting my solutions. Specifically, my Python solutions often result in runtime errors on certain test cases, while the equivalent C++ code works perfectly.

For instance, consider the following submissions:

Problem 1: C++ code Python code

Problem 2: C++ code Python code

In both cases, the Python code shows runtime errors on random test cases (such as 3 or 9), while the C++ code does not.

Has anyone else experienced similar issues? If so, what strategies or modifications did you employ to resolve them? Any insights or suggestions would be greatly appreciated.

Thanks in advance for your help!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it