SIGSEGV error (C++)

Hi,
I encountered a SIGSEGV error when I was attempting a problem. Here’s the solution that I submitted. Could anyone explain what was wrong in my code?

Please help me out. Thanks.

this is ur corrected code…http://www.codechef.com/viewsolution/3017997 …hope u get what mistake u were making…:slight_smile:

Edit: removed a few unused definitions…they were not wrong though!!!

Thanks! I got my mistake. Does including unused definitions or header files affect the compile time or result in runtime error?

no…not at all…i just removed it to make it a bit more readable…:stuck_out_tongue:

1 Like