Runtime error (SIGABRT) after submitting but not when running

I’m getting a SIGABRT runtime error in codechef’s IDE for my code. I understand that it is probably happening because my program is trying to access restricted memory but I’m not sure where exactly, the code is quite long so I’ll link the lines that I suspect might be causing it.
The lines are : 17, 31, 65 and 107.