結果

問題 No.40 多項式の割り算
ユーザー nbisco
提出日時 2016-04-19 23:52:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-10-04 14:15:42
合計ジャッジ時間 2,036 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#fileencoding: utf-8

D = int(input())
a = [int(i) for i in input().strip().split(" ")]
a.reverse()
for i in range(D-2):
    a[i+2] += a[i]
    a[i] = 0

a.reverse()
D = 0
for i in range(len(a)):
    if a[i] != 0:
        D = i
print(D)
for i in range(D+1):
    print(a[i], end=" ")
print()
0