Hello, for the ZCO 2014 afternoon problem “SMARTPHONE”, I’m submitting the following code in JAVA but there is a compilation error being shown, could someone please help me by putting up a correct code on how to correctly compile these programs.
ERROR:"
Standard error
/tmp/ccjoSEQH.o: In function main': cc24c7s8.i:(.text.startup+0xf): undefined reference to
SMARTPHONE::class$’
collect2: error: ld returned 1 exit status
"
CODE:
import java.io.*;
import java.util.Arrays;
class Mobile
{
public static void main(String[] args)throws IOException
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
long a[] = new long[t];
for (int i = 0; i <t; i++)
{
a[i] = Long.parseLong(br.readLine());
}
Arrays.sort(a);
int n=t;
long max=0;
for(int i=0;i < t;i++)
{
if(max<(a[i]*n))
max = a[i]*n;
n--;
}
System.out.println(max);
System.exit(1);
}
}