Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

abhishalya's blog

By abhishalya, history, 6 years ago, In English

Hi,

Have a look at my submission https://codeforces.com/contest/1096/submission/47671275. It throws weird error, can someone help me understand why the error only occurs on codeforces judge and not on any other.

It works fine on ideone https://ideone.com/ZwFeP2 and on my local machine.

Thanks!

  • Vote: I like it
  • -6
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Your program invokes undefined behavior. In this particular problem heap-buffer-overflow means out-of-bound array access.

See New: Diagnostics of Solutions in C++ — Codeforces

To debug your program, you can try using Catching silly mistakes with GCC — Codeforces