Submission #835819

#TimeUsernameProblemLanguageResultExecution timeMemory
835819iamjiamingliuMobile (BOI12_mobile)Cpython 3
0 / 100
1078 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: 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, 2 * 10 ** 9 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...