Submission #492214

#TimeUsernameProblemLanguageResultExecution timeMemory
492214ntarsisMobile (BOI12_mobile)Pypy 3
100 / 100
789 ms94948 KiB
from math import sqrt import sys n,l = map(int,input().split()) nums = [] for i in range(n): a,b = sys.stdin.readline().split() a = int(a) b = int(b) nums.append((a,b)) lo = 0 hi = 500000000 def check(x): intervals = [] curr = 0 for i in nums: a,b = i[0],i[1] bruh = (x-b)*(x+b) if bruh>=0: c = sqrt(bruh) part1 = a-c part2 = a+c if part1 <= curr and part2 > curr: curr = part2 if curr>=l: return True return False while hi - lo > 0.001: mid = (hi+lo)/2 if check(mid): hi = mid else: lo = mid sys.stdout.write(str(lo)+"\n")
#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...