結果

問題 No.40 多項式の割り算
ユーザー pekempeypekempey
提出日時 2016-01-08 17:29:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 7,140 KB
実行使用メモリ 7,112 KB
最終ジャッジ日時 2023-10-19 16:49:17
合計ジャッジ時間 2,342 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,504 KB
testcase_01 AC 12 ms
6,504 KB
testcase_02 AC 11 ms
6,504 KB
testcase_03 AC 11 ms
6,504 KB
testcase_04 AC 21 ms
6,728 KB
testcase_05 AC 23 ms
6,888 KB
testcase_06 AC 27 ms
7,112 KB
testcase_07 AC 28 ms
7,092 KB
testcase_08 AC 12 ms
6,524 KB
testcase_09 AC 22 ms
6,900 KB
testcase_10 AC 26 ms
7,060 KB
testcase_11 AC 20 ms
6,712 KB
testcase_12 AC 16 ms
6,660 KB
testcase_13 AC 26 ms
7,056 KB
testcase_14 AC 21 ms
6,724 KB
testcase_15 AC 20 ms
6,724 KB
testcase_16 AC 26 ms
7,060 KB
testcase_17 AC 15 ms
6,644 KB
testcase_18 AC 26 ms
7,048 KB
testcase_19 AC 28 ms
7,092 KB
testcase_20 AC 19 ms
6,696 KB
testcase_21 AC 14 ms
6,628 KB
testcase_22 AC 14 ms
6,604 KB
testcase_23 AC 18 ms
6,692 KB
testcase_24 AC 23 ms
6,888 KB
testcase_25 AC 11 ms
6,504 KB
testcase_26 AC 11 ms
6,504 KB
testcase_27 AC 11 ms
6,504 KB
testcase_28 AC 11 ms
6,504 KB
testcase_29 AC 11 ms
6,504 KB
testcase_30 AC 11 ms
6,504 KB
testcase_31 AC 12 ms
6,504 KB
testcase_32 AC 11 ms
6,504 KB
testcase_33 AC 12 ms
6,504 KB
testcase_34 AC 11 ms
6,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def f(x):
	ret = 0
	for i in xrange(D + 1):
		ret += a[i] * x ** i
	return ret

x = (f(1) + f(-1) - 2 * f(0)) / 2
y = (f(1) - f(-1)) / 2
z = f(0)

if x != 0:
	print 2
	print z, y, x
elif y != 0:
	print 1
	print z, y
else:
	print 0
	print z
0