結果

問題 No.450 ベー君のシャトルラン
ユーザー n_knuu
提出日時 2016-12-01 22:10:50
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 3,794 ms
コンパイル使用メモリ 65,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 20:44:02
合計ジャッジ時間 4,071 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils

let
  tmp = stdin.readline.split.map(parseInt)
  (vl, vr) = (tmp[0], tmp[1])
var d = stdin.readline.parseFloat
let w = stdin.readline.parseInt

var
  t1 = d / (vr + w).float
  t2 = (d - (vl + vr).float * t1) / (vl + w).float
let prev = (t1 + t2) * w.float
d -= (t1 + t2) * (vl + vr).float
t1 = d / (vr + w).float
t2 = (d - (vl + vr).float * t1) / (vl + w).float
let now = (t1 + t2) * w.float

echo(prev / (1 - now / prev))
0