Why I am getting an NZEC Exception even the code ran successfully in native JRE

Hello friends I am totally new to code chef and I was participating in the Summer Lunch Time competition today
There was a problem on Pebble game for which i had to make a program , here is my code :

import java.util.*;
import java.io.*;
class MyProgram{
 public static void main(String[] s){
   Scanner scan = new Scanner(System.in);
   Scanner scan2 = new Scanner(System.in);
   int numTest = Integer.parseInt(scan.nextLine());
   String[] myNumPiles = new String[numTest];
   int[] numPiles = new int[numTest];
   int[] maxPile = new int[numTest];
   String[] numStones = new String[numTest];
   for(int i = 0; i<numTest ; ++i){
     myNumPiles[i] = scan.nextLine();
	 numStones[i] = scan2.nextLine();
   }
     for(int i = 0; i<numTest ; ++i){
      numPiles[i] = Integer.parseInt(myNumPiles[i]);
    }
   ArrayList<Integer> sorting = new ArrayList<Integer>();
   for(int i = 0; i < numTest ; ++i){
     String[] tokens = numStones[i].split(" ");
	 for(String my : tokens){
	   sorting.add(Integer.parseInt(my));
	 }
	 Collections.sort(sorting);
	 for(int j=numPiles[i]-1 ; j>=0 ; j=j-2){
	  maxPile[i] += sorting.get(j);
	 }
	 sorting.clear();
   }
   //end of for i
   for(int i=0 ; i<numTest ; ++i)
    System.out.println(maxPile[i]);
 }
}

This program runs fine in my native JRE but when i submitted here it showed "Runtime Error(NZEC)"
I dont understand why I get this error , any help will be appreciated.

Thank you in advance :slight_smile: