結果

問題 No.40 多項式の割り算
ユーザー ciiro
提出日時 2021-12-14 00:45:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 307 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-07-23 01:06:12
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
a = list(map(int,input().split()))
for i in range(d + 1):
	if a[d - i] != 0:
		n = d - i
		if n < 3:
			break
		a[n - 2] += a[n]
		a[n] = 0

for i in range(3):
	if a[2 - i] != 0:
		dd = 2 - i
		a = a[:dd + 1]
		break
	if 2 - i == 0:
		dd = 0
		a = [0]

print(dd)
print(" ".join(map(str,a)))
0