結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー 👑 KazunKazun
提出日時 2022-03-15 01:38:09
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,519 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 87,936 KB
最終ジャッジ日時 2024-04-17 12:22:11
合計ジャッジ時間 8,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
65,408 KB
testcase_01 AC 1,557 ms
78,336 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 #

def General_Binary_Decrease_Search_Integer(L,R,cond,default=None):
    """条件式が単調減少であるとき, 整数上で二部探索を行う.
    L:解の下限
    R:解の上限
    cond:条件(1変数関数,広義単調減少 or 広義単調減少を満たす)
    default: Rで条件を満たさないときの返り値
    """

    if not(cond(L)): return default

    if cond(R): return R

    L-=1
    while R-L>1:
        C=L+(R-L)//2
        if cond(C): L=C
        else: R=C
    return L

#小数点以下第 k 位まで与えられる小数を 10^k 倍する.
def Decimal_to_Int(s: str, k: int, base=10):
    """ s*10^k を整数で出力する.

    s: 小数点を含むかもしれない数
    k: 小数点以下高々何位までか?
    base: 基数
    """

    if "." not in s:
        return int(s,base)*pow(base,k)

    m=s.index(".")
    return int(s.replace(".",""))*pow(base,k-(len(s)-m-1))

#==================================================
def answer(X):
    a,b=divmod(X,100)
    return str(a)+"."+str(b).zfill(2)

#==================================================
import sys

input=sys.stdin.readline
write=sys.stdout.write

N=int(input())

Ans=[None]*N

for n in range(N):
    T,mu,L=input()[:-1].split()

    T_100=Decimal_to_Int(T,2)
    mu_100=Decimal_to_Int(mu,2)
    L_100=Decimal_to_Int(L,2)

    check=lambda w:w*(25*w+18*T_100*mu_100)<=6480*mu_100*L_100

    V_100=0
    while check(V_100):
        V_100+=1
    V_100-=1

    Ans[n]=answer(V_100)

write("\n".join(Ans))
0