Submission #835847

#TimeUsernameProblemLanguageResultExecution timeMemory
835847iamjiamingliuMobile (BOI12_mobile)Cpython 3
0 / 100
1077 ms131072 KiB
import sys import math towers_cnt, line_len = map(int, sys.stdin.readline().strip().split()) towers = [tuple(map(int, sys.stdin.readline().strip().split())) for _ in range(towers_cnt)] def can_cover_whole_line(radius: float) -> bool: curr = 0 for x, y in towers: delta = math.sqrt(radius ** 2 - y ** 2) a, b = x - delta, x + delta if a <= curr: curr = max(curr, b) return curr >= line_len # total_dist = 0 # for x, height in towers: # if height > radius: continue # dist = math.sqrt(radius ** 2 - height ** 2) # if x - dist <= total_dist <= x + dist: # total_dist = x + dist # return total_dist >= line_len l, r = 0, 1.5e9 while not math.isclose(l, r): mid = (l + r) / 2 if can_cover_whole_line(radius=mid): r = mid else: l = mid print(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...