結果

問題 No.40 多項式の割り算
ユーザー yuki2006yuki2006
提出日時 2014-10-14 21:39:06
言語 Python2
(2.7.18)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 7,056 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2023-08-28 21:09:32
合計ジャッジ時間 1,886 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,080 KB
testcase_01 AC 11 ms
5,944 KB
testcase_02 AC 11 ms
5,944 KB
testcase_03 AC 12 ms
6,072 KB
testcase_04 AC 16 ms
6,168 KB
testcase_05 AC 17 ms
6,288 KB
testcase_06 AC 18 ms
6,384 KB
testcase_07 AC 19 ms
6,380 KB
testcase_08 AC 12 ms
5,948 KB
testcase_09 AC 17 ms
6,332 KB
testcase_10 AC 18 ms
6,512 KB
testcase_11 AC 15 ms
6,032 KB
testcase_12 AC 14 ms
6,032 KB
testcase_13 AC 18 ms
6,408 KB
testcase_14 AC 15 ms
6,124 KB
testcase_15 AC 16 ms
6,276 KB
testcase_16 AC 18 ms
6,396 KB
testcase_17 AC 13 ms
6,200 KB
testcase_18 AC 18 ms
6,516 KB
testcase_19 AC 19 ms
6,528 KB
testcase_20 AC 15 ms
6,252 KB
testcase_21 AC 12 ms
6,028 KB
testcase_22 AC 12 ms
5,964 KB
testcase_23 AC 15 ms
6,180 KB
testcase_24 AC 16 ms
6,332 KB
testcase_25 AC 11 ms
5,912 KB
testcase_26 AC 11 ms
6,004 KB
testcase_27 AC 11 ms
5,888 KB
testcase_28 AC 11 ms
5,936 KB
testcase_29 AC 11 ms
5,968 KB
testcase_30 AC 11 ms
5,840 KB
testcase_31 AC 11 ms
5,872 KB
testcase_32 AC 11 ms
5,860 KB
testcase_33 AC 11 ms
6,088 KB
testcase_34 AC 11 ms
6,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(raw_input())
b = map(int, raw_input().split())

for a in xrange(D, 2, -1):
    b[a - 2] += b[a]
    b[a] = 0

while len(b) > 0:
    if b[-1] == 0:
        del b[-1]
    else:
        break

if len(b) == 0:
    print 0
    print 0
else:
    print len(b) - 1
    print " ".join(map(str, b))
0