結果

問題 No.40 多項式の割り算
ユーザー kohei2019kohei2019
提出日時 2021-02-18 15:53:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 1,563 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 76,516 KB
最終ジャッジ日時 2023-10-13 00:00:47
合計ジャッジ時間 5,562 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,380 KB
testcase_01 AC 76 ms
71,172 KB
testcase_02 AC 77 ms
71,404 KB
testcase_03 AC 78 ms
71,312 KB
testcase_04 AC 83 ms
76,428 KB
testcase_05 AC 82 ms
76,404 KB
testcase_06 AC 81 ms
76,236 KB
testcase_07 AC 82 ms
76,120 KB
testcase_08 AC 77 ms
71,388 KB
testcase_09 AC 84 ms
76,320 KB
testcase_10 AC 83 ms
76,104 KB
testcase_11 AC 82 ms
76,092 KB
testcase_12 AC 84 ms
76,516 KB
testcase_13 AC 82 ms
76,048 KB
testcase_14 AC 84 ms
76,012 KB
testcase_15 AC 83 ms
76,080 KB
testcase_16 AC 83 ms
76,052 KB
testcase_17 AC 82 ms
76,244 KB
testcase_18 AC 85 ms
76,352 KB
testcase_19 AC 81 ms
76,144 KB
testcase_20 AC 81 ms
76,252 KB
testcase_21 AC 82 ms
76,020 KB
testcase_22 AC 82 ms
76,072 KB
testcase_23 AC 81 ms
76,296 KB
testcase_24 AC 82 ms
76,136 KB
testcase_25 AC 76 ms
71,332 KB
testcase_26 AC 77 ms
71,140 KB
testcase_27 AC 78 ms
71,208 KB
testcase_28 AC 77 ms
71,448 KB
testcase_29 AC 78 ms
71,344 KB
testcase_30 AC 78 ms
71,212 KB
testcase_31 AC 79 ms
71,088 KB
testcase_32 AC 77 ms
71,412 KB
testcase_33 AC 78 ms
71,316 KB
testcase_34 AC 76 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
lsa = list(map(int,input().split()))
if D <= 2:
    print(D)
    print(*lsa,sep=' ')
    exit()

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

lsans = lsa[:3]
if lsans.count(0) == 3:
    print(0)
    print(0)
    exit()

for i in range(2,-1,-1):
    if lsans[i] != 0:
        D = i
        break
print(D)
print(*lsans[:D+1],sep=' ')
0