結果

問題 No.40 多項式の割り算
ユーザー 👑 KazunKazun
提出日時 2020-10-03 20:08:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,308 KB
実行使用メモリ 76,364 KB
最終ジャッジ日時 2023-09-25 06:25:29
合計ジャッジ時間 4,719 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,184 KB
testcase_01 AC 74 ms
71,328 KB
testcase_02 AC 72 ms
71,404 KB
testcase_03 AC 75 ms
71,460 KB
testcase_04 AC 75 ms
76,216 KB
testcase_05 AC 75 ms
76,060 KB
testcase_06 AC 77 ms
75,900 KB
testcase_07 AC 76 ms
75,824 KB
testcase_08 AC 74 ms
75,324 KB
testcase_09 AC 78 ms
76,204 KB
testcase_10 AC 82 ms
76,224 KB
testcase_11 AC 81 ms
76,192 KB
testcase_12 AC 78 ms
76,100 KB
testcase_13 AC 78 ms
76,008 KB
testcase_14 AC 74 ms
76,296 KB
testcase_15 AC 77 ms
75,900 KB
testcase_16 AC 78 ms
75,872 KB
testcase_17 AC 76 ms
76,364 KB
testcase_18 AC 75 ms
76,072 KB
testcase_19 AC 77 ms
76,040 KB
testcase_20 AC 78 ms
75,920 KB
testcase_21 AC 78 ms
75,924 KB
testcase_22 AC 76 ms
76,160 KB
testcase_23 AC 77 ms
75,936 KB
testcase_24 AC 77 ms
76,008 KB
testcase_25 AC 72 ms
71,388 KB
testcase_26 AC 73 ms
71,420 KB
testcase_27 AC 72 ms
71,596 KB
testcase_28 AC 72 ms
71,560 KB
testcase_29 AC 73 ms
71,164 KB
testcase_30 AC 73 ms
71,368 KB
testcase_31 AC 75 ms
71,496 KB
testcase_32 AC 78 ms
71,384 KB
testcase_33 AC 75 ms
71,316 KB
testcase_34 AC 76 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(A,x):
    c=1
    K=0
    for a in A:
        K+=a*c
        c*=x
    return K

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

s=f(A,0)
t=f(A,1)
u=f(A,-1)

a=(t+u)//2-s
b=(t-u)//2
c=s

if a:
    print(2)
    print(c,b,a)
elif b:
    print(1)
    print(c,b)
else:
    print(0)
    print(c)
0