結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー KudeKude
提出日時 2022-06-17 21:49:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,707 ms / 3,000 ms
コード長 464 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 8,040 KB
最終ジャッジ日時 2023-08-23 12:13:12
合計ジャッジ時間 42,273 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,928 KB
testcase_01 AC 310 ms
7,980 KB
testcase_02 AC 1,235 ms
7,972 KB
testcase_03 AC 851 ms
7,836 KB
testcase_04 AC 226 ms
7,832 KB
testcase_05 AC 1,065 ms
7,912 KB
testcase_06 AC 1,671 ms
7,908 KB
testcase_07 AC 1,695 ms
7,920 KB
testcase_08 AC 1,698 ms
8,040 KB
testcase_09 AC 1,676 ms
7,920 KB
testcase_10 AC 1,672 ms
7,852 KB
testcase_11 AC 1,707 ms
7,916 KB
testcase_12 AC 1,699 ms
7,920 KB
testcase_13 AC 1,698 ms
8,040 KB
testcase_14 AC 1,671 ms
7,908 KB
testcase_15 AC 1,671 ms
7,924 KB
testcase_16 AC 1,682 ms
7,880 KB
testcase_17 AC 1,663 ms
7,984 KB
testcase_18 AC 1,652 ms
7,916 KB
testcase_19 AC 1,656 ms
7,984 KB
testcase_20 AC 1,660 ms
7,920 KB
testcase_21 AC 1,659 ms
7,888 KB
testcase_22 AC 1,671 ms
7,900 KB
testcase_23 AC 1,635 ms
7,968 KB
testcase_24 AC 1,663 ms
7,932 KB
testcase_25 AC 1,668 ms
7,920 KB
testcase_26 AC 16 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt
for _ in range(int(input())):
    tf, mf, lf = map(float, input().split())
    t = int(tf * 100 + 0.5)
    m = int(mf * 100 + 0.5)
    l = int(lf * 100 + 0.5)
    r2 = 36 * 36 * ((10 * m * t) ** 2 + 20 * 10000 * m * l)
    r = isqrt(r2)
    ans = r - 360 * m * t
    ans //= 1000
    print(f'{ans // 100}.{ans % 100:02d}')
    # vt+v^2/20m=l
    # v^2 +20mt v -20ml=0
    # v=-10mt + sqrt((10mt)^2+20ml) = 20ml / (10mt + sqrt((10mt)^2+20ml))
0