結果

問題 No.40 多項式の割り算
コンテスト
ユーザー matsu7874
提出日時 2015-03-20 06:19:10
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 348 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 498 ms
コンパイル使用メモリ 20,596 KB
実行使用メモリ 20,460 KB
最終ジャッジ日時 2026-03-18 06:58:33
合計ジャッジ時間 4,957 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

D = int(input())
A = [int(x) for x in input().split()]
if D>2:
    for i in range(3,D+1)[::-1]:
        A[i-2] += A[i]
if A[2] == 0:
    if A[1] == 0:
        print(0)
        print(A[0])
    else:
        print(1)
        print(''.join(str(item) + ' ' for item in A[0:2]))
else:
    print(2)
    print(''.join(str(item) + ' ' for item in A[0:3]))
0