結果

問題 No.550 夏休みの思い出(1)
ユーザー imulanimulan
提出日時 2017-08-15 23:11:52
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 594 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 77,092 KB
最終ジャッジ日時 2024-04-21 12:37:53
合計ジャッジ時間 6,286 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
75,252 KB
testcase_01 AC 39 ms
58,368 KB
testcase_02 AC 32 ms
52,480 KB
testcase_03 AC 31 ms
52,096 KB
testcase_04 AC 31 ms
52,736 KB
testcase_05 AC 29 ms
52,480 KB
testcase_06 AC 31 ms
52,608 KB
testcase_07 AC 31 ms
52,096 KB
testcase_08 AC 32 ms
52,096 KB
testcase_09 AC 151 ms
75,404 KB
testcase_10 AC 151 ms
75,392 KB
testcase_11 AC 116 ms
75,264 KB
testcase_12 AC 122 ms
75,008 KB
testcase_13 AC 149 ms
75,012 KB
testcase_14 AC 150 ms
75,520 KB
testcase_15 RE -
testcase_16 AC 149 ms
74,932 KB
testcase_17 AC 151 ms
75,904 KB
testcase_18 AC 148 ms
75,600 KB
testcase_19 AC 149 ms
75,472 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 37 ms
58,752 KB
testcase_23 AC 40 ms
58,752 KB
testcase_24 AC 40 ms
58,624 KB
testcase_25 AC 37 ms
58,752 KB
testcase_26 AC 35 ms
57,856 KB
testcase_27 AC 35 ms
58,880 KB
testcase_28 AC 34 ms
58,752 KB
testcase_29 AC 35 ms
58,496 KB
testcase_30 AC 35 ms
57,984 KB
testcase_31 AC 143 ms
75,184 KB
testcase_32 AC 132 ms
75,648 KB
testcase_33 AC 136 ms
75,232 KB
testcase_34 AC 142 ms
75,176 KB
testcase_35 AC 134 ms
75,520 KB
testcase_36 AC 139 ms
75,904 KB
testcase_37 AC 149 ms
75,136 KB
testcase_38 AC 135 ms
75,140 KB
testcase_39 AC 139 ms
75,316 KB
testcase_40 AC 38 ms
57,856 KB
testcase_41 AC 38 ms
57,984 KB
testcase_42 AC 36 ms
58,368 KB
testcase_43 AC 34 ms
58,240 KB
testcase_44 AC 37 ms
57,984 KB
testcase_45 AC 36 ms
58,496 KB
testcase_46 AC 36 ms
58,400 KB
testcase_47 AC 35 ms
58,496 KB
testcase_48 AC 37 ms
57,984 KB
testcase_49 AC 41 ms
58,624 KB
testcase_50 AC 39 ms
57,856 KB
testcase_51 AC 37 ms
58,112 KB
testcase_52 AC 39 ms
58,248 KB
testcase_53 AC 83 ms
75,136 KB
testcase_54 AC 78 ms
75,520 KB
testcase_55 AC 60 ms
75,016 KB
testcase_56 AC 80 ms
75,116 KB
testcase_57 AC 93 ms
75,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = 1000000

def f(x,a,b,c):
    return x**3 + a*x**2 + b*x + c

def SQRT(n):
    l,r= 0,10**46
    while r-l>1:
        m = (l+r)//2
        if m*m <= n:
            l = m
        else:
            r = m
    return l

def main():
    A,B,C = map(int,input().split())

    p = -N+1
    while True:
        if f(p,A,B,C) == 0:
            break
        p += 1

    D = (p*B+C)**2 + 4*C*p**3
    sq = SQRT(D)

    q = (p*B+C + sq) // (2*p**2)
    r = (p*B+C - sq) // (2*p**2)

    ans = [p,q,r]
    ans.sort()
    print(' '.join(map(str,ans)))

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