結果

問題 No.40 多項式の割り算
ユーザー TomoyarnTomoyarn
提出日時 2023-08-26 13:42:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 76,508 KB
最終ジャッジ日時 2023-08-26 13:42:15
合計ジャッジ時間 4,118 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,408 KB
testcase_01 AC 65 ms
71,500 KB
testcase_02 AC 65 ms
71,308 KB
testcase_03 AC 66 ms
71,544 KB
testcase_04 AC 68 ms
76,236 KB
testcase_05 AC 69 ms
76,268 KB
testcase_06 AC 69 ms
76,392 KB
testcase_07 AC 75 ms
76,324 KB
testcase_08 AC 64 ms
71,156 KB
testcase_09 AC 70 ms
76,196 KB
testcase_10 AC 70 ms
76,232 KB
testcase_11 AC 71 ms
76,300 KB
testcase_12 AC 71 ms
76,232 KB
testcase_13 AC 70 ms
76,464 KB
testcase_14 AC 70 ms
76,280 KB
testcase_15 AC 71 ms
76,508 KB
testcase_16 AC 70 ms
76,268 KB
testcase_17 AC 70 ms
76,256 KB
testcase_18 AC 70 ms
76,344 KB
testcase_19 AC 70 ms
76,308 KB
testcase_20 AC 74 ms
76,252 KB
testcase_21 AC 69 ms
76,204 KB
testcase_22 AC 68 ms
76,168 KB
testcase_23 AC 70 ms
76,300 KB
testcase_24 AC 70 ms
76,216 KB
testcase_25 AC 65 ms
71,320 KB
testcase_26 AC 63 ms
71,164 KB
testcase_27 AC 65 ms
71,448 KB
testcase_28 AC 66 ms
71,136 KB
testcase_29 AC 64 ms
71,384 KB
testcase_30 AC 64 ms
71,316 KB
testcase_31 AC 65 ms
71,584 KB
testcase_32 AC 64 ms
71,348 KB
testcase_33 AC 66 ms
71,288 KB
testcase_34 AC 64 ms
71,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
b = list(map(int, input().split()))
b = b[::-1]
for i in range(D - 2):
    b[i + 2] += b[i]
    b[i] = 0

b = b[::-1][:3]
if len(b) >= 3:
    if b[2] == 0:
        b.pop(-1)
        if b[1] == 0:
            b.pop(-1)
print(len(b) - 1)
print(*b)
0