結果

問題 No.550 夏休みの思い出(1)
ユーザー nebukuro09nebukuro09
提出日時 2017-07-28 23:15:48
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 11:36:40
合計ジャッジ時間 2,073 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,400 KB
testcase_01 WA -
testcase_02 AC 10 ms
6,528 KB
testcase_03 AC 11 ms
6,400 KB
testcase_04 WA -
testcase_05 AC 10 ms
6,400 KB
testcase_06 AC 11 ms
6,272 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 10 ms
6,528 KB
testcase_10 AC 10 ms
6,528 KB
testcase_11 AC 9 ms
6,400 KB
testcase_12 AC 10 ms
6,528 KB
testcase_13 AC 10 ms
6,400 KB
testcase_14 AC 10 ms
6,528 KB
testcase_15 AC 10 ms
6,400 KB
testcase_16 AC 11 ms
6,400 KB
testcase_17 AC 10 ms
6,528 KB
testcase_18 AC 10 ms
6,400 KB
testcase_19 AC 10 ms
6,528 KB
testcase_20 AC 11 ms
6,400 KB
testcase_21 AC 10 ms
6,400 KB
testcase_22 AC 10 ms
6,400 KB
testcase_23 AC 11 ms
6,272 KB
testcase_24 AC 10 ms
6,528 KB
testcase_25 AC 10 ms
6,400 KB
testcase_26 AC 10 ms
6,400 KB
testcase_27 AC 9 ms
6,400 KB
testcase_28 AC 10 ms
6,528 KB
testcase_29 AC 10 ms
6,400 KB
testcase_30 AC 9 ms
6,400 KB
testcase_31 AC 10 ms
6,272 KB
testcase_32 AC 11 ms
6,400 KB
testcase_33 AC 8 ms
6,400 KB
testcase_34 AC 10 ms
6,528 KB
testcase_35 AC 10 ms
6,528 KB
testcase_36 AC 10 ms
6,528 KB
testcase_37 AC 10 ms
6,400 KB
testcase_38 AC 10 ms
6,400 KB
testcase_39 AC 11 ms
6,400 KB
testcase_40 AC 10 ms
6,400 KB
testcase_41 AC 11 ms
6,400 KB
testcase_42 AC 10 ms
6,528 KB
testcase_43 AC 10 ms
6,400 KB
testcase_44 AC 10 ms
6,528 KB
testcase_45 AC 10 ms
6,528 KB
testcase_46 AC 11 ms
6,528 KB
testcase_47 AC 11 ms
6,528 KB
testcase_48 AC 10 ms
6,400 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 10 ms
6,528 KB
testcase_52 AC 11 ms
6,528 KB
testcase_53 AC 10 ms
6,528 KB
testcase_54 AC 11 ms
6,400 KB
testcase_55 AC 9 ms
6,400 KB
testcase_56 AC 11 ms
6,400 KB
testcase_57 AC 11 ms
6,272 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 int(c), a, int(b)
0