結果

問題 No.450 ベー君のシャトルラン
ユーザー shoooooshooooo
提出日時 2019-12-01 19:24:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 391 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,504 KB
最終ジャッジ日時 2023-08-13 18:38:28
合計ジャッジ時間 4,619 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,500 KB
testcase_01 AC 17 ms
8,476 KB
testcase_02 AC 16 ms
8,428 KB
testcase_03 AC 15 ms
8,308 KB
testcase_04 AC 16 ms
8,472 KB
testcase_05 AC 15 ms
8,376 KB
testcase_06 AC 15 ms
8,312 KB
testcase_07 AC 15 ms
8,492 KB
testcase_08 AC 15 ms
8,404 KB
testcase_09 AC 15 ms
8,424 KB
testcase_10 AC 15 ms
8,496 KB
testcase_11 AC 15 ms
8,380 KB
testcase_12 AC 15 ms
8,464 KB
testcase_13 AC 15 ms
8,476 KB
testcase_14 AC 15 ms
8,328 KB
testcase_15 AC 15 ms
8,504 KB
testcase_16 AC 15 ms
8,372 KB
testcase_17 AC 15 ms
8,376 KB
testcase_18 AC 16 ms
8,376 KB
testcase_19 AC 15 ms
8,480 KB
testcase_20 AC 16 ms
8,400 KB
testcase_21 TLE -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
Vl,Vr=map(int,input().split())
d=int(input())
w=int(input())
ans=0
cnt=0
e=10**-7
while d>0:
  if cnt%2==0:
    time=d/(w+Vr)
    ans+=(w*time)
    d-=((Vl+Vr)*time)
    cnt+=1
    if (Vl+Vr)*time<=e:
      print(ans)
      sys.exit()
  else:
    time=d/(w+Vl)
    ans+=(w*time)
    d-=((Vl+Vr)*time)
    cnt+=1
    if (Vl+Vr)*time<=e:
      print(ans)
      sys.exit()
print(ans)
0