I ve written code in erlang and i am getting correct answer in my machine. But when i am submitting it in spoj.pl it is giving nzec(non zero exit code) error. I have used inbuilt functions like halt() and init:stop() and their specification clearly says that they are used to avoid non zero exit code error.But still i am geting same error. Anybody having idea? or have tried some problem in spoj using erlang ?