This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
from collections import deque
n = int(input())
x, r = [], []
def getrj(ri, xi, xj):
return (xj-xi)*(xj-xi)/(4*ri)
assert (getrj(9, 0, 13)) - 4.694 <= 0.001
for i in range(n):
xi, ri = map(int, input().split())
x.append(xi)
r.append(ri)
st = deque()
r2 = []
for bal in range(n):
cands = [r[bal]]
for other in range(bal):
cands.append(getrj(r2[other], x[other], x[bal]))
mn = min(cands)
print(mn)
r2.append(mn)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |