結果

問題 No.40 多項式の割り算
ユーザー szkhtsszkhts
提出日時 2023-06-11 07:44:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 271 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 30,508 KB
最終ジャッジ日時 2023-08-31 01:50:08
合計ジャッジ時間 6,731 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
29,584 KB
testcase_01 AC 133 ms
29,464 KB
testcase_02 AC 130 ms
29,520 KB
testcase_03 AC 129 ms
29,476 KB
testcase_04 AC 139 ms
30,048 KB
testcase_05 AC 133 ms
30,084 KB
testcase_06 AC 136 ms
30,388 KB
testcase_07 AC 140 ms
30,376 KB
testcase_08 AC 133 ms
29,540 KB
testcase_09 AC 136 ms
30,020 KB
testcase_10 AC 137 ms
30,304 KB
testcase_11 AC 136 ms
30,000 KB
testcase_12 AC 131 ms
29,920 KB
testcase_13 AC 139 ms
30,352 KB
testcase_14 AC 137 ms
30,068 KB
testcase_15 AC 133 ms
30,048 KB
testcase_16 AC 133 ms
30,256 KB
testcase_17 AC 131 ms
29,724 KB
testcase_18 AC 139 ms
30,384 KB
testcase_19 AC 140 ms
30,508 KB
testcase_20 AC 135 ms
30,008 KB
testcase_21 AC 133 ms
29,648 KB
testcase_22 AC 131 ms
29,652 KB
testcase_23 AC 133 ms
29,892 KB
testcase_24 AC 138 ms
30,092 KB
testcase_25 AC 131 ms
29,588 KB
testcase_26 AC 131 ms
29,576 KB
testcase_27 AC 132 ms
29,464 KB
testcase_28 AC 131 ms
29,512 KB
testcase_29 AC 130 ms
29,544 KB
testcase_30 AC 129 ms
29,536 KB
testcase_31 AC 127 ms
29,464 KB
testcase_32 AC 133 ms
29,496 KB
testcase_33 AC 128 ms
29,464 KB
testcase_34 AC 126 ms
29,480 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 len(a) >= 3:
    if a[2]:
        ans = 2
    elif a[1]:
        ans = 1

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