結果
| 問題 |
No.2010 Magical Floor
|
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2022-07-15 23:14:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 731 bytes |
| コンパイル時間 | 345 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 77,568 KB |
| 最終ジャッジ日時 | 2024-06-27 20:34:17 |
| 合計ジャッジ時間 | 3,049 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 20 |
ソースコード
import math
t=int(input())
for _ in range(t):
n,x=map(int,input().split())
h=list(map(int,input().split()))
v=list(map(int,input().split()))
for i in range(n):
if v[i]==0:
v[i]=1000000000000000000000
else:
v[i]=1/v[i]
x/=2
ans=x/v[0]
currmax=v[0]
for i in range(1,n):
currdist=0
ans1=0
fail=0
if v[i]>currmax:
currmax=v[i]
currsin=v[0]/v[i]
for j in range(i):
theta=math.asin(currsin)
currdist+=h[j]*math.tan(theta)
if currdist>x:
fail=1
break
ans1+=h[j]/(math.cos(theta)*v[j])
currsin=currsin*v[j+1]/v[j]
ans1+=(x-currdist)/v[i]
if fail==0:
ans=min(ans1,ans)
print(2*ans)
yuusanlondon