結果

問題 No.550 夏休みの思い出(1)
ユーザー 👑 KazunKazun
提出日時 2020-09-05 03:46:16
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,145 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 80,260 KB
最終ジャッジ日時 2023-08-18 03:09:15
合計ジャッジ時間 5,099 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,884 KB
testcase_01 RE -
testcase_02 AC 74 ms
71,632 KB
testcase_03 AC 77 ms
71,432 KB
testcase_04 AC 74 ms
71,264 KB
testcase_05 AC 74 ms
71,484 KB
testcase_06 AC 74 ms
71,232 KB
testcase_07 AC 75 ms
71,416 KB
testcase_08 AC 75 ms
71,304 KB
testcase_09 AC 76 ms
71,428 KB
testcase_10 AC 76 ms
71,376 KB
testcase_11 TLE -
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 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def General_Binary_Increase_Search(L,R,cond,Integer=True,ep=1/(1<<20)):
    """条件式が単調増加であるとき,一般的な二部探索を行う.
    L:解の下限
    R:解の上限
    cond:条件(1変数関数,広義単調減少 or 広義単調減少を満たす)
    Integer:解を整数に制限するか?
    ep:Integer=Falseのとき,解の許容する誤差
    """
    if not(cond(R)):
        return False

    if Integer:
        R+=1
        while R-L>1:
            C=L+(R-L)//2
            if cond(C):
                R=C
            else:
                L=C
        return R
    else:
        while (R-L)>=ep:
            C=L+(R-L)/2
            if cond(C):
                R=C
            else:
                L=C
        return R
#================================================
from math import sqrt,floor
A,B,C=map(int,input().split())

phi=-(A+sqrt(A*A-3*B))/3
alpha=General_Binary_Increase_Search(-10**9,phi,lambda x:C+x*(B+x*(A+x))>=0,False,1/(1<<30))
alpha=floor(alpha+1/2)

P=alpha+A
Q=alpha**2+A*alpha+B

D=P*P-4*Q
sqrt_D=floor(sqrt(D)+1/2)

beta=(-P-sqrt_D)//2
gamma=(-P+sqrt_D)//2

print(alpha,beta,gamma)
0