A weird error is torturing me here.
It is an NZEC error.
The code runs properly in Eclipse. But Codechef’s compiler isn’t happy.
My Code:
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class chef
{
public static void main(String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++)
{
Scanner in=new Scanner(System.in);
int flag=0;
String s=in.nextLine();
int N=s.charAt(0)-48;
int K=s.charAt(2)-48;
String st=in.nextLine();
String A[]=st.split(" ");
for(int j=0;j<(N-1);j++)
for(int k=j+1;k<N;k++)
{
int a=Integer.parseInt(A[j]);
int b=Integer.parseInt(A[j]);
if((a+b)==K)
flag=1;
}
if(flag==1)
System.out.println(“Yes”);
else
System.out.println(“No”);
}
}
}
The Error: