結果

問題 No.550 夏休みの思い出(1)
ユーザー sekiya9311sekiya9311
提出日時 2017-07-29 11:40:03
言語 Python2
(2.7.18)
結果
AC  
実行時間 644 ms / 2,000 ms
コード長 522 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 70,064 KB
最終ジャッジ日時 2024-04-19 13:17:45
合計ジャッジ時間 23,689 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 633 ms
69,896 KB
testcase_01 AC 591 ms
69,908 KB
testcase_02 AC 80 ms
69,828 KB
testcase_03 AC 78 ms
69,900 KB
testcase_04 AC 80 ms
69,944 KB
testcase_05 AC 79 ms
69,968 KB
testcase_06 AC 78 ms
69,984 KB
testcase_07 AC 77 ms
69,916 KB
testcase_08 AC 77 ms
69,964 KB
testcase_09 AC 643 ms
69,820 KB
testcase_10 AC 642 ms
69,696 KB
testcase_11 AC 548 ms
69,880 KB
testcase_12 AC 565 ms
69,820 KB
testcase_13 AC 633 ms
69,992 KB
testcase_14 AC 625 ms
70,000 KB
testcase_15 AC 548 ms
69,964 KB
testcase_16 AC 635 ms
69,900 KB
testcase_17 AC 626 ms
69,820 KB
testcase_18 AC 631 ms
69,828 KB
testcase_19 AC 638 ms
69,900 KB
testcase_20 AC 635 ms
69,932 KB
testcase_21 AC 644 ms
69,692 KB
testcase_22 AC 168 ms
69,988 KB
testcase_23 AC 272 ms
69,964 KB
testcase_24 AC 247 ms
69,900 KB
testcase_25 AC 94 ms
69,900 KB
testcase_26 AC 98 ms
69,940 KB
testcase_27 AC 99 ms
69,888 KB
testcase_28 AC 98 ms
69,880 KB
testcase_29 AC 179 ms
69,892 KB
testcase_30 AC 134 ms
69,908 KB
testcase_31 AC 587 ms
69,948 KB
testcase_32 AC 577 ms
69,912 KB
testcase_33 AC 566 ms
69,928 KB
testcase_34 AC 595 ms
70,064 KB
testcase_35 AC 574 ms
69,920 KB
testcase_36 AC 581 ms
69,816 KB
testcase_37 AC 593 ms
69,888 KB
testcase_38 AC 586 ms
70,004 KB
testcase_39 AC 574 ms
69,936 KB
testcase_40 AC 322 ms
69,936 KB
testcase_41 AC 320 ms
69,760 KB
testcase_42 AC 238 ms
69,900 KB
testcase_43 AC 93 ms
69,960 KB
testcase_44 AC 92 ms
69,900 KB
testcase_45 AC 91 ms
69,928 KB
testcase_46 AC 90 ms
69,912 KB
testcase_47 AC 174 ms
69,820 KB
testcase_48 AC 326 ms
69,956 KB
testcase_49 AC 328 ms
69,960 KB
testcase_50 AC 331 ms
69,896 KB
testcase_51 AC 304 ms
69,932 KB
testcase_52 AC 320 ms
70,000 KB
testcase_53 AC 422 ms
69,824 KB
testcase_54 AC 405 ms
69,884 KB
testcase_55 AC 353 ms
70,040 KB
testcase_56 AC 420 ms
70,008 KB
testcase_57 AC 456 ms
69,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
a = 0
b = 0
c = 0
def calc(x):
    return x * x * x + a * x * x + b * x + c

a, b, c = map(int, raw_input().split())
ans = []
for al in range(int(-1e6), int(1e6) + 1):
    if calc(al) == 0:
        ans.append(al)
        A = 1
        B = a + al
        C = a * al + al * al + b
        ans.append((-B + math.sqrt(B * B - 4 * A * C)) / (2 * A))
        ans.append((-B - math.sqrt(B * B - 4 * A * C)) / (2 * A))
        break
ans.sort()
print str(int(ans[0])) + " " + str(int(ans[1])) + " " + str(int(ans[2]));
0