What type of error is this

Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/py_compile.py”, line 117, in compile
raise py_exc
py_compile.PyCompileError: File “prog.py”, line 2
import java.util.*;
^
SyntaxError: invalid syntax

what kind of error is this.
The program is working properly on notepad IDE

i think so you ran your java file in python compiler

1 Like

I have re-checked it on your say but it as not the case.

import java.util.;
import java.lang.
;
import java.io.*;
class codechef1{
public static void main(String []args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int i,j;
int T=Integer.parseInt(br.readLine()); //no. of test cases
int mai[]=new int[T];
for(i=0;i<T;i++)
{
int N=Integer.parseInt(br.readLine()); //no.of available cans
int M=Integer.parseInt(br.readLine()); //minutes to reach home
int K=Integer.parseInt(br.readLine()); //outsider tmeperature
int L=Integer.parseInt(br.readLine()); //lower limit
int R=Integer.parseInt(br.readLine()); //upper limit
int[] C=new int[N]; //can temperature
int[] P=new int[N]; //price
mai[i]=-1;
for(j=0;j<N;j++){
C[j]=Integer.parseInt(br.readLine());
P[j]=Integer.parseInt(br.readLine());
}
for(j=0;j<N;j++)
{
if(C[j]>K+1)
C[j]=C[j]-M;
else if(C[j]<K-1)
C[j]=C[j]+M;
else
C[j]=K;
if(C[j]>=L && C[j]<=R){
if(mai[i]!=-1 && P[j]<mai[i])
mai[i]=P[j];
else if(mai[i]==-1)
mai[i]=P[j];
}
}
}
for(i=0;i<T;i++)
{
System.out.println(mai[i]);
}
}
}

Happened to me as well…Submit using Non-IDE mode, make sure to set language as Java

checked
Runtime Error(NZEC)
this error is coming

Is it because of this line? You forgot to inset * after .?

That might just be because the OP didn’t use “Preformatted text” and so the forum software tried to parse his Java code as markdown, eating the “*”'s etc.

I think you are misunderstanding the format in which codechef requires input and output. The solution of each test case is outputted just after input of the test case and then, next test case follows. NOT printing output of all test cases together.

thank you sir, it was helpful