Getting a Runtime error although runs fine on my machine..Kindly help

The Problem is:-
link text

My Solution: link text
The solution runs well on my local machine but is giving a SIGSEGV error when i am trying to submit it on CodeChef. Kindly do help.

//