結果

問題 No.40 多項式の割り算
ユーザー yaoshimax
提出日時 2015-02-22 03:01:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-06-23 21:49:15
合計ジャッジ時間 1,622 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

D=int(raw_input())
a = map(int, raw_input().split())
for i in range(len(a)-1,2,-1):
    a[i-2] += a[i]
    a[i] = 0

d=0
for i in range( min(2,len(a)-1), -1,-1 ):
    if (a[i]!=0 or i==0):
        print i
        d=i+1
        break
for i in range(d):
    print a[i],
print
0