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

Автор royappa, история, 6 лет назад, По-английски

Any general ideas on how to debug RUNTIME_ERROR on huge inputs in the systests? Here's my submission: https://mirror.codeforces.com/contest/1092/submission/47535638

  • I cannot copy the full input (it is truncated with "...") for local testing with gdb
  • I tried compiling with execinfo.h to use a stack backtrace handler, but that doesn't compile (no surprise)

My code gives RUNTIME_ERROR on test #7 and both times it says memory used is exactly 10000KB, but the memory limit is 256MB. It does seems odd that the crash would come at that exact point of memory (and both times).

Thanks for any tips on what I'm doing wrong. Not asking for algorithm help, as I have read the editorial. Just trying to implement.

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

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

i recommend just doing random test. Your program seems to crash on this examples:

14
1 0 0 1 0 0 0 0 1 0 0 1 0 1
10
1 0 0 1 1 0 0 1 0 1