結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー Akijin_007Akijin_007
提出日時 2022-06-17 22:28:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 412 ms / 3,000 ms
コード長 872 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 81,996 KB
実行使用メモリ 139,136 KB
最終ジャッジ日時 2024-04-17 14:40:00
合計ジャッジ時間 12,371 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,412 KB
testcase_01 AC 131 ms
87,900 KB
testcase_02 AC 314 ms
121,176 KB
testcase_03 AC 237 ms
108,020 KB
testcase_04 AC 111 ms
82,880 KB
testcase_05 AC 280 ms
116,432 KB
testcase_06 AC 400 ms
139,136 KB
testcase_07 AC 405 ms
138,764 KB
testcase_08 AC 402 ms
138,996 KB
testcase_09 AC 396 ms
138,640 KB
testcase_10 AC 408 ms
139,016 KB
testcase_11 AC 410 ms
138,640 KB
testcase_12 AC 402 ms
138,880 KB
testcase_13 AC 401 ms
139,032 KB
testcase_14 AC 394 ms
138,652 KB
testcase_15 AC 404 ms
139,020 KB
testcase_16 AC 401 ms
138,624 KB
testcase_17 AC 407 ms
138,764 KB
testcase_18 AC 400 ms
138,636 KB
testcase_19 AC 412 ms
138,644 KB
testcase_20 AC 409 ms
138,772 KB
testcase_21 AC 404 ms
138,652 KB
testcase_22 AC 400 ms
138,784 KB
testcase_23 AC 404 ms
138,896 KB
testcase_24 AC 409 ms
139,016 KB
testcase_25 AC 405 ms
138,908 KB
testcase_26 AC 33 ms
54,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())

T = [0] * N
for i in range(N):
    # T[i] = list(map(float, input().split()))
    T[i] = input().split()

for i in range(N):
    for j in range(3):
        s = T[i][j]
        T[i][j] = int(s[:-3]) * 100 + int(s[-2:]) * 1

def S(v, t, m, l):
    v *= 1000 / 3600
    return (v * t * 20 * m) + (v * v) - (l * 20 * m * 10 ** 4)


# print(T)

for i in range(N):
    t = T[i][0]
    m = T[i][1]
    l = T[i][2]
    # print(t, m, l)

    vmax = 52000000
    vmin = 0

    while vmax - vmin > 1:
        h = (vmax + vmin) // 2
        if S(h, t, m, l) > 0:
            vmax = h
        else:
            vmin = h

    # print(format(int(vmin*100)/100, ".2f"))
    # print(vmin)
    # print(vmin)
    vmin //= 100

    c, d = divmod(vmin, 100)
    print(str(c) + "." + format(d, "02d"))
0