[HELP]HashTable spoj Hashit, help with the code.

Hi,
I am practicing questions on hash table. I solved this question of spoj SPOJ.com - Problem HASHIT and here is my code iGsnkq - Online C++ Compiler & Debugging Tool - Ideone.com

Whats wrong with this code. Its a hash table question and I think if it gives right answer for test case and my own test cases then why a “WA” ?

Any help is appreciated. thanks.