rangerscowboys's blog

By rangerscowboys, history, 9 months ago, In English

I was working on today's contest, Codeforces Round 933 (Div. 3). On problem F, I had gotten a Runtime Error. I spent over an hour debugging it, and finally did, but wasted a lot of time. It turned out my issue was having an empty set and doing operations on it. skul

Is there any way to quickly find where is your Runtime Error in your code? I have gotten Runtime Error multiple times, and debugging is always the most annoying part. skul

Thanks!

  • Vote: I like it
  • +7
  • Vote: I do not like it

»
9 months ago, # |
  Vote: I like it +1 Vote: I do not like it
»
9 months ago, # |
  Vote: I like it +3 Vote: I do not like it

by sucking blood

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Have you heard of address sanitizer? Depending on what IDE you use, address sanitizer can help you find errors and convert it to something that you can understand. As a Clion user, all I need to add is one simple line to my CMakeLists.txt -> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")