結果

問題 No.550 夏休みの思い出(1)
ユーザー nebukuro09nebukuro09
提出日時 2017-07-28 23:18:10
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 527 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 6,064 KB
最終ジャッジ日時 2023-08-01 13:50:06
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,064 KB
testcase_01 AC 10 ms
5,976 KB
testcase_02 AC 11 ms
5,908 KB
testcase_03 AC 11 ms
5,908 KB
testcase_04 AC 10 ms
5,972 KB
testcase_05 AC 11 ms
5,932 KB
testcase_06 AC 11 ms
5,968 KB
testcase_07 AC 10 ms
5,932 KB
testcase_08 AC 11 ms
6,016 KB
testcase_09 AC 11 ms
5,872 KB
testcase_10 AC 11 ms
6,056 KB
testcase_11 AC 11 ms
5,992 KB
testcase_12 AC 10 ms
5,992 KB
testcase_13 AC 11 ms
5,896 KB
testcase_14 AC 11 ms
5,896 KB
testcase_15 AC 11 ms
5,944 KB
testcase_16 AC 11 ms
6,020 KB
testcase_17 AC 11 ms
5,864 KB
testcase_18 AC 11 ms
6,056 KB
testcase_19 AC 11 ms
5,968 KB
testcase_20 AC 12 ms
5,968 KB
testcase_21 AC 12 ms
5,908 KB
testcase_22 AC 10 ms
6,024 KB
testcase_23 AC 10 ms
5,860 KB
testcase_24 AC 10 ms
5,988 KB
testcase_25 AC 12 ms
5,864 KB
testcase_26 AC 11 ms
5,996 KB
testcase_27 AC 11 ms
5,968 KB
testcase_28 AC 10 ms
5,964 KB
testcase_29 AC 11 ms
5,944 KB
testcase_30 AC 11 ms
5,920 KB
testcase_31 AC 11 ms
5,860 KB
testcase_32 AC 11 ms
5,972 KB
testcase_33 AC 11 ms
5,980 KB
testcase_34 AC 12 ms
5,860 KB
testcase_35 AC 11 ms
5,908 KB
testcase_36 AC 11 ms
6,064 KB
testcase_37 AC 11 ms
5,896 KB
testcase_38 AC 11 ms
5,900 KB
testcase_39 AC 11 ms
5,960 KB
testcase_40 AC 11 ms
5,900 KB
testcase_41 AC 11 ms
5,860 KB
testcase_42 AC 11 ms
5,932 KB
testcase_43 AC 11 ms
5,924 KB
testcase_44 AC 11 ms
5,964 KB
testcase_45 AC 11 ms
6,028 KB
testcase_46 AC 11 ms
6,056 KB
testcase_47 AC 11 ms
5,964 KB
testcase_48 AC 10 ms
5,992 KB
testcase_49 AC 11 ms
5,992 KB
testcase_50 AC 12 ms
5,964 KB
testcase_51 AC 10 ms
5,976 KB
testcase_52 AC 11 ms
5,860 KB
testcase_53 AC 10 ms
5,864 KB
testcase_54 AC 11 ms
5,944 KB
testcase_55 AC 11 ms
5,976 KB
testcase_56 AC 11 ms
5,992 KB
testcase_57 AC 11 ms
5,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

A, B, C = map(int, raw_input().split())

f = lambda x: x*x*x + A*x*x + B*x + C

S = (-2 * A + sqrt(4 * A * A - 12 * B)) / 6.0
T = (-2 * A - sqrt(4 * A * A - 12 * B)) / 6.0

hi = int(S) + 1
lo = int(T) - 1

while hi - lo > 1:
    mid = (hi + lo) / 2
    if f(mid) > 0:
        lo = mid
    else:
        hi = mid

a = lo if f(lo) == 0 else hi

AA = A + a
BB = B + a * (A + a)

b = (-AA + sqrt(AA*AA - 4*BB)) / 2.0
c = (-AA - sqrt(AA*AA - 4*BB)) / 2.0
print ' '.join(map(str, sorted([a, int(b), int(c)])))
0