Strange segfault on SPOJ KQUERY

Revision en1, by brdy, 2018-03-11 22:48:53

Here is my AC code: https://hastebin.com/ewobuzater.cpp

It uses offline BIT + sorting.

Here is the strange thing: que[200001] works perfectly fine, but if you change it to que[200000] it will segfault. However, it is zero based indexing and q is at max 200000.

Can anyone think of a case where que[200000] faces out of bound access?

Tags bug

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English brdy 2018-03-11 22:48:53 373 Initial revision (published)