Submission #309258

#TimeUsernameProblemLanguageResultExecution timeMemory
309258TruaShamuMobile (BOI12_mobile)Java
Compilation error
0 ms0 KiB
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class BOI12 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        ArrayList<Point> pList = new ArrayList<>();
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());

        //Read in points
        for (int i = 0; i < N; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            pList.add(new Point(x, y));
        }

        double left = 1, right = 5e8;
        while (right - left > 1e-3) {
            double mid = (left + right) / 2;
            double curr = 0;
            for (int i = 0; i < N; i++) {
                double delta = Math.pow(mid * mid - pList.get(i).y * pList.get(i).y, 1 / 2); //(sqrt)
                double a = pList.get(i).x - delta;
                double b = pList.get(i).x + delta;
                if (a <= curr) {
                    curr = Double.max(curr, b);
                }
            }

            if (curr >= M) {
                right = mid;
            } else {
                left = mid;
            }
        }

    }
}


Compilation message (stderr)

mobile.java:7: error: class BOI12 is public, should be declared in a file named BOI12.java
public class BOI12 {
       ^
mobile.java:11: error: cannot find symbol
        ArrayList<Point> pList = new ArrayList<>();
                  ^
  symbol:   class Point
  location: class BOI12
mobile.java:20: error: cannot find symbol
            pList.add(new Point(x, y));
                          ^
  symbol:   class Point
  location: class BOI12
3 errors