SIMPSTAT problem

https://www.codechef.com/viewsolution/26148206
why my code is giving segmentation error
it is working fine on dev c++ IDE.