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

Автор rangerscowboys, история, 4 месяца назад, По-английски

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!

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

»
4 месяца назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
»
4 месяца назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

by sucking blood

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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")