結果

問題 No.40 多項式の割り算
ユーザー 👑 Kazun
提出日時 2020-10-03 20:08:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 61,684 KB
最終ジャッジ日時 2024-07-18 05:24:43
合計ジャッジ時間 2,822 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

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