結果

問題 No.40 多項式の割り算
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-17 00:50:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 76,728 KB
最終ジャッジ日時 2023-08-23 06:45:58
合計ジャッジ時間 4,446 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,328 KB
testcase_01 AC 70 ms
71,608 KB
testcase_02 AC 69 ms
71,592 KB
testcase_03 AC 68 ms
71,376 KB
testcase_04 AC 74 ms
76,504 KB
testcase_05 AC 75 ms
76,496 KB
testcase_06 AC 73 ms
76,636 KB
testcase_07 AC 74 ms
76,528 KB
testcase_08 AC 70 ms
71,356 KB
testcase_09 AC 75 ms
76,580 KB
testcase_10 AC 75 ms
76,476 KB
testcase_11 AC 76 ms
76,480 KB
testcase_12 AC 74 ms
76,684 KB
testcase_13 AC 75 ms
76,728 KB
testcase_14 AC 75 ms
76,508 KB
testcase_15 AC 76 ms
76,504 KB
testcase_16 AC 75 ms
76,412 KB
testcase_17 AC 75 ms
76,640 KB
testcase_18 AC 75 ms
76,432 KB
testcase_19 AC 74 ms
76,376 KB
testcase_20 AC 73 ms
76,692 KB
testcase_21 AC 73 ms
76,464 KB
testcase_22 AC 77 ms
76,676 KB
testcase_23 AC 77 ms
76,632 KB
testcase_24 AC 75 ms
76,300 KB
testcase_25 AC 70 ms
71,128 KB
testcase_26 AC 71 ms
71,436 KB
testcase_27 AC 70 ms
71,524 KB
testcase_28 AC 69 ms
71,324 KB
testcase_29 AC 70 ms
71,268 KB
testcase_30 AC 69 ms
71,444 KB
testcase_31 AC 68 ms
71,312 KB
testcase_32 AC 69 ms
71,584 KB
testcase_33 AC 70 ms
71,444 KB
testcase_34 AC 69 ms
71,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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