KPRIME - Simple code in java throwing NZEC. pls help me figure out why

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.StringTokenizer;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		
		int [] markedCount = new int[100001];
		
		for(int i = 2; i <= 100000; i++) {
			if(markedCount[i] == 0) {
				for(int j = i; j <= 100000; j += i) {
					markedCount[j] += 1;
				}
			}
		}
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder result = new StringBuilder();
		int T = Integer.parseInt(br.readLine());
		int A, B, K;
		StringTokenizer sz;
		while(T-- > 0) {
			sz = new StringTokenizer(br.readLine(), " ");
			
			A = Integer.parseInt(sz.nextToken());
			B = Integer.parseInt(sz.nextToken());
			K = Integer.parseInt(sz.nextToken());
			
			int resultN = 0;
			for(int i = A; i <= B; i++) {
				if(markedCount[i] == K) {
					resultN++;
				}
			}
			result.append(resultN+"\n");
		}
		
		System.out.println(result);

	}

}

Can some one help me figure where the exception is thrown? I tried but din’t get a clue :frowning:

@prav90 : Maybe this is related to :

http://discuss.codechef.com/questions/19172/java-submissions-re

Code Chef was upgrading java compiler so all submissions were having Runtime error

However that is resolved now .

If you continue to have this problem of Runtime Error , then mention it that it is not related to compiler upgrade and i will have a look at your code .

Please update if you are still getting Runtime Exception .

@prav90 : Yes could not find a source of exception in your earlier solution also . Need to report this to bugs@codechef.com or feedback@codechef.com as the ERROR CODE returned should be correct . Will investigate this a bit more and if i feel TLE is showing as RE then I will write to admins . Meanwhile if you are sure you may write to CodeChef.

@vineetpaliwal : I’m still getting NZEC. This is the solution i submitted http://www.codechef.com/viewsolution/2413907

@vineetpaliwal: I got an AC with this solution http://www.codechef.com/viewsolution/2414046. I think codechef is reporting NZEC for TLE, because my previous solution was naive, and I wasn’t able to find a place where exceptions could be thrown in my previous submissions.