結果

問題 No.40 多項式の割り算
コンテスト
ユーザー realDivineJK
提出日時 2020-05-21 16:58:31
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 164 ms / 5,000 ms
コード長 361 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 417 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 15,448 KB
最終ジャッジ日時 2026-04-18 08:14:22
合計ジャッジ時間 7,156 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

D = int(input())
A = list(map(int, input().split()))
fn1, f0, f1 = 0, A[0], 0
sign = 1
for i in range(D+1):
    f1 += A[i]
    fn1 += sign * A[i]
    sign *= -1
a, b, c = (f1 + fn1 - 2 * f0) // 2, (f1 - fn1) // 2, f0
if a != 0:
    print(2)
    print(c, b, a)
else:
    if b != 0:
        print(1)
        print(c, b)
    else:
        print(0)
        print(c)
0