結果

問題 No.1980 [Cherry 4th Tune D] 停止距離
ユーザー ygd.ygd.
提出日時 2022-06-17 22:29:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 731 ms / 3,000 ms
コード長 1,471 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 78,224 KB
最終ジャッジ日時 2024-04-17 14:40:59
合計ジャッジ時間 18,119 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,540 KB
testcase_01 AC 186 ms
77,340 KB
testcase_02 AC 509 ms
77,380 KB
testcase_03 AC 417 ms
77,400 KB
testcase_04 AC 161 ms
77,208 KB
testcase_05 AC 501 ms
77,440 KB
testcase_06 AC 697 ms
77,476 KB
testcase_07 AC 670 ms
77,532 KB
testcase_08 AC 717 ms
77,784 KB
testcase_09 AC 676 ms
77,584 KB
testcase_10 AC 731 ms
78,224 KB
testcase_11 AC 645 ms
77,928 KB
testcase_12 AC 695 ms
77,364 KB
testcase_13 AC 695 ms
77,676 KB
testcase_14 AC 690 ms
77,752 KB
testcase_15 AC 697 ms
77,228 KB
testcase_16 AC 586 ms
76,848 KB
testcase_17 AC 599 ms
76,540 KB
testcase_18 AC 599 ms
76,880 KB
testcase_19 AC 609 ms
77,092 KB
testcase_20 AC 580 ms
76,788 KB
testcase_21 AC 588 ms
76,524 KB
testcase_22 AC 622 ms
76,920 KB
testcase_23 AC 691 ms
76,868 KB
testcase_24 AC 652 ms
76,644 KB
testcase_25 AC 598 ms
76,784 KB
testcase_26 AC 31 ms
53,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]

def hantei(x,T,m,L):
    # val = v**2 + 20*m*T*v - 20*m*L
    val = 125*x**2 + 90*m*T*x - 360*90*m*L
    return val <= 0

def float_to_int(x):
    x = str(x)
    xa,xb = x.split('.')
    ret = int(xa) * 100 + int(xb)
    return ret

def main():
    N = int(input())
    for _ in range(N):
        T,m,L = map(str,input().split())
        TT = float_to_int(T)
        mm = float_to_int(m)
        LL = float_to_int(L)
        #print(TT,mm,LL)
        # xの最大値と最小値。答えはこれを100で割る
        ng = pow(10,9)
        ok = 0
        while abs(ok-ng) > 1:
            mid = (ok+ng)//2
            if hantei(mid,TT,mm,LL):
                ok = mid
            else:
                ng = mid
        ok = str(ok)
        if len(ok) == 1:
            ans = '0.0' + str(ok)
        elif len(ok) == 2:
            ans = '0.' + str(ok)
        else:
            ans = ok[:-2] + '.' + ok[-2:]
        print(ans)




if __name__ == '__main__':
    main()
0