RUN_TIME ERROR .. Can't figure out why??

my code : : http://ideone.com/RkNTKK

problem link : : http://www.spoj.com/problems/ELIS/

I m still a beginner . Suggestions , if my logic or code is wrong :slight_smile: !