alien chef : runtime error

my code for the problem alien chef in easy problems is giving run time error but it works fine on my machine.Could you please help me to rectify the code.i think it is related to these things

  1. i have used double dimentional array which has its max limit 10^9 x 20
  2. i have used delete operator which i removed from the code later
  3. i have used exit(1)

You cannot declare arrays more than 10^7 or sometimes 10^8 in the worst case. Only option is doing it in lesser memory.There is no way to allocate so much memory to a program. Please read about SIGABRT HERE.