結果

問題 No.40 多項式の割り算
ユーザー rlangevin
提出日時 2023-01-14 16:36:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 1,130 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 60,544 KB
最終ジャッジ日時 2024-12-26 01:49:00
合計ジャッジ時間 4,080 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
A = list(map(int, input().split()))
c = A[0]
x, y = -c, -c
for i, v in enumerate(A):
    x += v
    y += v * (-1) ** (i%2)
a = (x + y)//2
b = (x - y)//2
if a == 0:
    if b == 0:
        print(0)
        print(c)
    else:
        print(1)
        print(c, b)
else:
    print(2)
    print(c, b, a)
0