結果

問題 No.40 多項式の割り算
ユーザー 👑 rin204rin204
提出日時 2022-01-20 21:13:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 224 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,660 KB
最終ジャッジ日時 2023-08-15 21:13:33
合計ジャッジ時間 4,553 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,260 KB
testcase_01 AC 62 ms
71,196 KB
testcase_02 AC 61 ms
71,316 KB
testcase_03 AC 60 ms
71,404 KB
testcase_04 AC 80 ms
76,576 KB
testcase_05 AC 67 ms
76,372 KB
testcase_06 AC 67 ms
76,420 KB
testcase_07 AC 67 ms
76,316 KB
testcase_08 AC 61 ms
71,340 KB
testcase_09 AC 68 ms
76,632 KB
testcase_10 AC 65 ms
76,380 KB
testcase_11 AC 67 ms
76,564 KB
testcase_12 AC 66 ms
76,496 KB
testcase_13 AC 65 ms
76,300 KB
testcase_14 AC 66 ms
76,380 KB
testcase_15 AC 66 ms
76,316 KB
testcase_16 AC 65 ms
76,660 KB
testcase_17 AC 66 ms
76,552 KB
testcase_18 AC 66 ms
76,328 KB
testcase_19 AC 66 ms
76,488 KB
testcase_20 AC 64 ms
76,548 KB
testcase_21 AC 69 ms
76,500 KB
testcase_22 AC 66 ms
76,460 KB
testcase_23 AC 65 ms
76,336 KB
testcase_24 AC 65 ms
76,528 KB
testcase_25 AC 59 ms
71,072 KB
testcase_26 AC 60 ms
71,348 KB
testcase_27 AC 61 ms
71,368 KB
testcase_28 AC 61 ms
71,388 KB
testcase_29 AC 61 ms
71,460 KB
testcase_30 AC 61 ms
71,416 KB
testcase_31 AC 61 ms
71,268 KB
testcase_32 AC 62 ms
71,372 KB
testcase_33 AC 61 ms
71,308 KB
testcase_34 AC 62 ms
71,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

while A and A[-1] == 0:
    A.pop()

if A:
    print(len(A) - 1)
    print(*A)
else:
    print(0)
    print(0)
0