結果

問題 No.40 多項式の割り算
ユーザー szkhtsszkhts
提出日時 2023-06-11 07:39:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 239 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 30,512 KB
最終ジャッジ日時 2023-08-31 01:49:21
合計ジャッジ時間 11,773 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
29,516 KB
testcase_01 AC 132 ms
29,656 KB
testcase_02 AC 129 ms
29,572 KB
testcase_03 AC 129 ms
29,524 KB
testcase_04 AC 130 ms
30,032 KB
testcase_05 AC 135 ms
30,140 KB
testcase_06 AC 133 ms
30,452 KB
testcase_07 AC 137 ms
30,512 KB
testcase_08 AC 129 ms
29,660 KB
testcase_09 AC 129 ms
30,132 KB
testcase_10 AC 132 ms
30,388 KB
testcase_11 AC 130 ms
30,060 KB
testcase_12 AC 129 ms
29,912 KB
testcase_13 AC 134 ms
30,332 KB
testcase_14 AC 131 ms
30,000 KB
testcase_15 AC 132 ms
29,996 KB
testcase_16 AC 136 ms
30,288 KB
testcase_17 AC 134 ms
29,848 KB
testcase_18 AC 136 ms
30,200 KB
testcase_19 AC 138 ms
30,408 KB
testcase_20 AC 137 ms
30,028 KB
testcase_21 AC 134 ms
29,664 KB
testcase_22 AC 133 ms
29,768 KB
testcase_23 AC 134 ms
29,948 KB
testcase_24 AC 134 ms
30,192 KB
testcase_25 AC 130 ms
29,452 KB
testcase_26 AC 130 ms
29,604 KB
testcase_27 AC 136 ms
29,560 KB
testcase_28 RE -
testcase_29 AC 130 ms
29,556 KB
testcase_30 AC 130 ms
29,536 KB
testcase_31 AC 129 ms
29,556 KB
testcase_32 AC 132 ms
29,588 KB
testcase_33 AC 128 ms
29,496 KB
testcase_34 AC 127 ms
29,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

D = int(input())
a = list(map(int, input().split())) 

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

ans = 0
if a[2]:
    ans = 2
elif a[1]:
    ans = 1

print(ans)
print(" ".join(map(str, a[0:ans + 1])))
0