Getting java NZEC error on codechef compiler

Guys i am trying to solve the DAG Delete problem of December contest. My code runs perfectly fine on my computer and i have tested it for multiple cases. I have also made sure that everything is properly initialized and checked for corner cases too. Earlier i was using too much memory and even that is not the case now. Please tell me what are the not so common reasons where you people got Run Time Error or how should i proceed with debugging my code.

Best Regards

1 Like

can you provide test cases for which you are getting error

I am facing the same problem in directing edges question. any suggestions?

hi
i have tried to solve this package it’s working fine when i try it but when i upload the answer i get NZEC so plz someone help!
this is my code
java application1;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
int arr[][] = new int[100][2];

int x = sc.nextInt();
int y = sc.nextInt();

int ii = 0;
while ((x!=-1)&&(y!=-1)){
    arr[ii][0] = x;
    arr[ii][1] = y;
    ii++;
     x = sc.nextInt();
 y = sc.nextInt();
}

for (int i = 0; i < ii; i++) {
    

        x = arr[i][0];

        y = arr[i][1];
        if ((x == 1) || (y == 1)){

            System.out.println(x + "+" + y + "=" + (x + y));
        }

else{
System.out.println(x + “+” + y + " !=" + (x + y));
}
}

}
}

In languages which have exception handling like Java , Python etc we can use exception hadling using try - catch blocks. NZEC is a runtime error . It mostly occurs when negative array index is accesed or the program which we have written takes up more space than the allocated memory for our program to run.

data science with python online training
data science online training
aws online training
rpa online training
devops online trainng

Everyone loves it when individuals get together and share thoughts. Great blog, continue the good work!

Advanced Java Training in Bangalore

UI Development Training in Marathahalli

There’s definitely a lot to know about this issue. I really like all the points you made.
web designing courses in bangalore
PHP training in Bangalore
UI development training in Bangalore