結果

問題 No.40 多項式の割り算
ユーザー ああいいああいい
提出日時 2022-04-21 14:52:36
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2023-09-04 21:19:40
合計ジャッジ時間 5,962 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,212 KB
testcase_01 AC 75 ms
71,456 KB
testcase_02 AC 73 ms
71,404 KB
testcase_03 AC 73 ms
71,396 KB
testcase_04 AC 79 ms
76,400 KB
testcase_05 AC 81 ms
76,356 KB
testcase_06 AC 78 ms
76,476 KB
testcase_07 AC 79 ms
76,356 KB
testcase_08 AC 71 ms
71,392 KB
testcase_09 AC 77 ms
76,320 KB
testcase_10 AC 79 ms
76,356 KB
testcase_11 AC 78 ms
76,356 KB
testcase_12 AC 77 ms
76,584 KB
testcase_13 AC 78 ms
76,420 KB
testcase_14 AC 79 ms
76,644 KB
testcase_15 AC 78 ms
76,800 KB
testcase_16 AC 80 ms
76,792 KB
testcase_17 AC 80 ms
76,296 KB
testcase_18 AC 78 ms
76,716 KB
testcase_19 AC 80 ms
76,376 KB
testcase_20 AC 79 ms
76,388 KB
testcase_21 AC 77 ms
76,372 KB
testcase_22 AC 78 ms
76,632 KB
testcase_23 AC 80 ms
76,336 KB
testcase_24 AC 79 ms
76,588 KB
testcase_25 AC 73 ms
71,392 KB
testcase_26 AC 73 ms
71,368 KB
testcase_27 AC 74 ms
71,316 KB
testcase_28 AC 75 ms
71,412 KB
testcase_29 AC 71 ms
71,484 KB
testcase_30 AC 72 ms
71,300 KB
testcase_31 AC 72 ms
71,128 KB
testcase_32 AC 72 ms
71,400 KB
testcase_33 AC 71 ms
71,356 KB
testcase_34 AC 72 ms
71,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import sys
if D == 0:
    print(0)
    print(a[0])
    exit()
for i in range(3,D+1):
    if i % 2 == 1:
        a[1] += a[i]
    else:
        a[2] += a[i]
a = a[:3]
while a and a[-1] == 0:
    a.pop()
if not a:
    print(0)
    print(0)
else:
    print(len(a) - 1)
    print(*a)
0