結果

問題 No.40 多項式の割り算
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-26 19:24:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 7,080 KB
実行使用メモリ 6,608 KB
最終ジャッジ日時 2023-09-18 11:49:00
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,028 KB
testcase_01 AC 12 ms
6,196 KB
testcase_02 AC 12 ms
5,900 KB
testcase_03 AC 12 ms
6,020 KB
testcase_04 AC 15 ms
6,224 KB
testcase_05 AC 16 ms
6,348 KB
testcase_06 AC 18 ms
6,440 KB
testcase_07 AC 18 ms
6,608 KB
testcase_08 AC 12 ms
6,188 KB
testcase_09 AC 15 ms
6,228 KB
testcase_10 AC 17 ms
6,580 KB
testcase_11 AC 15 ms
6,120 KB
testcase_12 AC 13 ms
6,080 KB
testcase_13 AC 18 ms
6,552 KB
testcase_14 AC 15 ms
6,124 KB
testcase_15 AC 15 ms
6,152 KB
testcase_16 AC 17 ms
6,500 KB
testcase_17 AC 13 ms
6,064 KB
testcase_18 AC 17 ms
6,576 KB
testcase_19 AC 18 ms
6,592 KB
testcase_20 AC 15 ms
6,260 KB
testcase_21 AC 13 ms
6,016 KB
testcase_22 AC 12 ms
6,232 KB
testcase_23 AC 14 ms
6,116 KB
testcase_24 AC 16 ms
6,388 KB
testcase_25 AC 11 ms
6,028 KB
testcase_26 AC 12 ms
5,952 KB
testcase_27 AC 12 ms
6,172 KB
testcase_28 AC 11 ms
5,904 KB
testcase_29 AC 12 ms
6,104 KB
testcase_30 AC 12 ms
6,128 KB
testcase_31 AC 12 ms
6,144 KB
testcase_32 AC 12 ms
6,028 KB
testcase_33 AC 12 ms
5,948 KB
testcase_34 AC 12 ms
5,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from itertools import dropwhile
rstrip = lambda arr, p: list(reversed(list(dropwhile(lambda x: x == p, reversed(arr)))))

d = int(raw_input())
a = map(int, raw_input().split())
for i in xrange(d, 2, -1):
    a[i-2] += a[i]
res = rstrip(a[:3], 0)
print max(0, len(res) - 1)
print ' '.join(map(str, res)) or 0
0