結果

問題 No.550 夏休みの思い出(1)
ユーザー fiordfiord
提出日時 2017-07-29 13:30:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-19 13:18:14
合計ジャッジ時間 3,022 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import math
a, b, c = map(int, input().split())
l = -10**32
r = 10**32
for i in range(1000):
    m = (l + r) / 2.0
    if m**3 + a * m**2 + b * m + c > 0:
        r = m
    else:
        l = m
s = int(l - 10)
while s <= r + 10:
    if s**3 + a * s**2 + b * s + c != 0:
        s += 1
    else:
        break
d = a + s
e = b + d * s
l = d / -2.0
r = 10**32
for i in range(1000):
    m = (l + r) / 2.0
    if m**2 + d * m + e > 0:
        r = m
    else:
        l = m
t = int(l - 10)
while t <= r + 10:
    if t**2 + d * t + e != 0:
        t += 1
    else:
        break
u = -a - s - t
ret = [s, t, u]
ret.sort()
for i in range(3):
    ret[i] = str(int(ret[i] + 10**-9 if ret[i] > 0 else ret[i] - 10**-9))
print(" ".join(ret))
0