# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
562079 | 2022-05-14T05:14:51 Z | jh05013 | Lonely mdic (kriii1_L) | Java 11 | 2000 ms | 23916 KB |
import java.awt.geom.*; import java.util.*; import java.io.*; public class L { public static void main(String[] args){ Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int n = sc.nextInt(); List<Area> circs = new Vector(); List<Area> prec = new Vector(); List<Area> sufc = new Vector(); for(int i = 0; i < n; i++){ double x = sc.nextDouble(); double y = sc.nextDouble(); double r = sc.nextDouble(); Ellipse2D.Double c = new Ellipse2D.Double(x-r, y-r, 2*r, 2*r); Area car = new Area(c); circs.add(car); prec.add((Area) car.clone()); sufc.add((Area) car.clone()); } for(int i = 1; i < n; i++) prec.get(i).add(prec.get(i-1)); for(int i = n-2; i >= 0; i--) sufc.get(i).add(sufc.get(i+1)); int ans = 0; for(int i = 0; i < n; i++){ Area a = (Area) circs.get(i).clone(); if(i != 0) a.subtract(prec.get(i-1)); if(i != n-1) a.subtract(sufc.get(i+1)); if(a.isEmpty()) ans++; } sb.append(ans); System.out.println(sb); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1324 ms | 22952 KB | Output is correct |
2 | Execution timed out | 2053 ms | 23916 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |