Submission #310095

#TimeUsernameProblemLanguageResultExecution timeMemory
310095TruaShamuMobile (BOI12_mobile)Java
Compilation error
0 ms0 KiB
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.text.DecimalFormat; 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()); Point[] p = new Point[1000000]; int N = Integer.parseInt(st.nextToken()); int length = Integer.parseInt(st.nextToken()); //Read in points for (int i = 0; i < N; i++) { st = new StringTokenizer(br.readLine()); long x = Integer.parseInt(st.nextToken()); long y = Integer.parseInt(st.nextToken()); p[i] = (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 - p[i].y * p[i].y, 0.5); //(sqrt) double a = p[i].x - delta; double b = p[i].x + delta; if (a <= curr) { curr = Double.max(curr, b); } } if (curr >= length) { right = mid; } else { left = mid; } } DecimalFormat df = new DecimalFormat("#.#######"); System.out.println(df.format(left)); //System.out.println(left); } } class Point implements Comparable<Point> { public long x, y; public Point(long x, long y) { this.x = x; this.y = y; } public int compareTo(Point other) { if (this.x != other.x) { return Long.compare(this.x, other.x); } else { return Long.compare(other.y, this.y); } } }

Compilation message (stderr)

mobile.java:7: error: class BOI12 is public, should be declared in a file named BOI12.java
public class BOI12 {
       ^
1 error