結果

問題 No.550 夏休みの思い出(1)
ユーザー 👑 KazunKazun
提出日時 2020-09-05 03:45:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,141 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 87,364 KB
実行使用メモリ 71,772 KB
最終ジャッジ日時 2023-08-18 03:07:29
合計ジャッジ時間 6,901 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 75 ms
71,436 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 74 ms
71,528 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 73 ms
71,464 KB
testcase_08 AC 73 ms
71,540 KB
testcase_09 WA -
testcase_10 AC 74 ms
71,172 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 75 ms
71,288 KB
testcase_50 AC 74 ms
71,644 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

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<<20)
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