結果

問題 No.40 多項式の割り算
ユーザー 双六双六
提出日時 2020-07-22 13:38:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 630 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 77,428 KB
最終ジャッジ日時 2023-09-02 10:52:28
合計ジャッジ時間 5,128 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,852 KB
testcase_01 AC 88 ms
71,876 KB
testcase_02 AC 92 ms
71,588 KB
testcase_03 AC 89 ms
71,504 KB
testcase_04 AC 94 ms
77,020 KB
testcase_05 AC 97 ms
77,048 KB
testcase_06 AC 96 ms
77,104 KB
testcase_07 AC 97 ms
77,060 KB
testcase_08 AC 92 ms
71,632 KB
testcase_09 AC 95 ms
77,204 KB
testcase_10 AC 98 ms
77,208 KB
testcase_11 AC 95 ms
77,124 KB
testcase_12 AC 100 ms
76,972 KB
testcase_13 AC 97 ms
77,156 KB
testcase_14 AC 97 ms
77,428 KB
testcase_15 AC 98 ms
77,268 KB
testcase_16 AC 99 ms
77,316 KB
testcase_17 AC 97 ms
77,168 KB
testcase_18 AC 101 ms
77,264 KB
testcase_19 AC 96 ms
77,204 KB
testcase_20 AC 100 ms
77,372 KB
testcase_21 AC 97 ms
77,060 KB
testcase_22 AC 96 ms
77,028 KB
testcase_23 AC 97 ms
77,312 KB
testcase_24 AC 98 ms
77,212 KB
testcase_25 AC 92 ms
71,748 KB
testcase_26 AC 94 ms
71,632 KB
testcase_27 AC 91 ms
71,636 KB
testcase_28 AC 92 ms
71,708 KB
testcase_29 AC 91 ms
71,884 KB
testcase_30 AC 92 ms
71,764 KB
testcase_31 AC 91 ms
71,392 KB
testcase_32 AC 92 ms
71,640 KB
testcase_33 AC 91 ms
71,684 KB
testcase_34 AC 92 ms
71,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	D = int(input())
	A = getlist()
	if D <= 2:
		print(D)
		print(*A)
		return

	for i in range(D - 2):
		a = A[-1 - i]
		A[-1 - i] = 0
		A[-3 - i] += a

	# print(A)
	if A[2] == 0:
		if A[1] == 0:
			if A[0] == 0:
				print(0)
				print(0)
			else:
				print(0)
				print(A[0])
		else:
			print(1)
			print(A[0], A[1])
	else:
		print(2)
		print(A[0], A[1], A[2])



if __name__ == '__main__':
	main()
0