Submission #623045

#TimeUsernameProblemLanguageResultExecution timeMemory
62304554skyxenonMobile (BOI12_mobile)Cpython 3
25 / 100
1096 ms71280 KiB
# https://oj.uz/problem/view/BOI12_mobile EPS = 0.0001 n, l = map(int, input().split()) def dist(c1, c2): return ((c1[0] - c2[0]) ** 2 + (c1[1] - c2[1]) ** 2) ** 0.5 coordinates = [] for _ in range(n): x, y = map(int, input().split()) coordinates.append((x, y)) def merge(intervals): new_intervals = [] for start, end in sorted(intervals): if not new_intervals or new_intervals[-1][1] < start: new_intervals.append([start, end]) else: new_intervals[-1][1] = max(new_intervals[-1][1], end) return new_intervals def bs(lo, hi): def ok(radius): intervals = [(0, 0), (l, l)] for x1, y1 in coordinates: term = (radius ** 2) - (y1 ** 2) if term >= 0: term_sqrt = term ** 0.5 intervals.append((x1 - term_sqrt, x1 + term_sqrt)) intervals = merge(intervals) m = len(intervals) - 1 return any(0 <= (intervals[i][1] + intervals[i + 1][0]) / 2 <= l for i in range(m)) while lo + EPS < hi: mid = (lo + hi) / 2 if not ok(mid): hi = mid else: lo = mid return lo print(bs(0, l))
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...