Strange Bug.

Revision en1, by rasterize, 2016-02-14 19:07:49

Hello, I encountered a strange bug while solving POJ 3278 .

here's my AC solution: http://ideone.com/FdyTlU

Strangely I get WA using G++ if I remove line 38 which shouldn't serve any purpose (I tried using random values instead of -1 and still got AC) But works on C++ (even without including the line) Is there something related to the compilers that causes this? Or did I somehow invoke undefined behavior?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English rasterize 2016-12-16 23:10:55 4
en2 English rasterize 2016-12-16 23:10:16 398
en1 English rasterize 2016-02-14 19:07:49 466 Initial revision (published)