結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
コンテスト
ユーザー TKG1
提出日時 2022-06-17 22:23:38
言語 Crystal
(1.21.0 + ACL)
コンパイル:
crystal build -Donline_judge -o a.out --release --no-debug _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 604 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 12,156 ms
コンパイル使用メモリ 365,844 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-12 11:40:07
合計ジャッジ時間 35,828 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 TLE * 4 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# require "debug"
require "big"
alias LL = Int64
macro chmin(x, y); {{x}} = {{y}} if {{x}} > {{y}}; end
macro chmax(x, y); {{x}} = {{y}} if {{x}} < {{y}}; end
macro yn(x); {{x}} ? "Yes" : "No"; end

# ---------------------------------------------------- :)

def f(t,u,v)
  return v*t + (v*v)/(u*20)
end

read_line.to_i.times do
  t, u, l = read_line.split.map(&.to_big_f)
  ng = 0.to_big_f
  ok = 10000000000.to_big_f
  while ok-ng > 0.0000000000000000001
    mid = (ok+ng)/2
    if f(t,u,mid) <= l
      ng = mid
    else
      ok = mid
    end
  end
  x = ((ng*360).to_i)/100
  printf("%.2f\n", x)
end
0