結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー TKG1TKG1
提出日時 2022-06-17 22:55:58
言語 Crystal
(1.11.2)
結果
TLE  
実行時間 -
コード長 597 bytes
コンパイル時間 20,830 ms
コンパイル使用メモリ 344,600 KB
実行使用メモリ 10,656 KB
最終ジャッジ日時 2024-04-17 15:17:40
合計ジャッジ時間 23,556 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
9,088 KB
testcase_01 AC 1,711 ms
5,248 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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 = 5111.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