QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#105034 | #5505. Great Chase | kingstonduy | RE | 0ms | 0kb | Python3 | 735b | 2023-05-12 21:00:01 | 2023-05-12 21:00:24 |
Judging History
answer
tc= int(input())
while(tc != 0):
tc-=1
sc= float(input.split())
n= sc[0]
v= sc[1]
a=[]
for i in range (n):
sc= float(input.split())
a.append((sc[0],sc[1]))
l=0
r=1e12
res=0
e= 1e-10
while(l<=r and l+e < r):
mid= (l+r)/2
ls= -1e18
rs= 1e18
for i in range (n):
temp1, temp2= a[i]
dis= temp2 * mid
if(temp1 < 0):
ls=max(ls, temp1 + dis)
else:
rs= min(rs, temp1 - dis)
if(ls <= rs):
res= max(res, mid)
l= mid+e
else:
r= mid-e
output = "{:.10f}".format(res * v)
print(output)
詳細信息
Test #1:
score: 0
Runtime Error
input:
3 4 9 10 2 -7 2 -6 1 7 1 2 8 -1 7 1 6 2 3 -1000000000000 1 1000000000000 1