結果

問題 No.40 多項式の割り算
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-17 00:48:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 76,732 KB
最終ジャッジ日時 2023-08-23 06:43:49
合計ジャッジ時間 4,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,428 KB
testcase_01 AC 72 ms
71,520 KB
testcase_02 AC 70 ms
71,248 KB
testcase_03 AC 70 ms
71,608 KB
testcase_04 AC 75 ms
76,464 KB
testcase_05 AC 77 ms
76,632 KB
testcase_06 AC 77 ms
76,308 KB
testcase_07 AC 76 ms
76,620 KB
testcase_08 AC 71 ms
71,196 KB
testcase_09 AC 77 ms
76,732 KB
testcase_10 AC 75 ms
76,452 KB
testcase_11 AC 76 ms
76,484 KB
testcase_12 AC 75 ms
76,444 KB
testcase_13 AC 74 ms
76,312 KB
testcase_14 AC 78 ms
76,484 KB
testcase_15 AC 76 ms
76,568 KB
testcase_16 AC 77 ms
76,668 KB
testcase_17 AC 77 ms
76,480 KB
testcase_18 AC 77 ms
76,428 KB
testcase_19 AC 80 ms
76,484 KB
testcase_20 AC 78 ms
76,600 KB
testcase_21 AC 77 ms
76,480 KB
testcase_22 AC 76 ms
76,480 KB
testcase_23 AC 80 ms
76,512 KB
testcase_24 AC 75 ms
76,500 KB
testcase_25 AC 71 ms
71,340 KB
testcase_26 AC 68 ms
71,420 KB
testcase_27 AC 71 ms
71,384 KB
testcase_28 WA -
testcase_29 AC 69 ms
71,508 KB
testcase_30 AC 70 ms
71,672 KB
testcase_31 AC 72 ms
71,688 KB
testcase_32 AC 70 ms
71,432 KB
testcase_33 AC 70 ms
71,508 KB
testcase_34 AC 72 ms
71,164 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(0)
    else:
        print(1)
        print(b0, b1)
else:
    print(2)
    print(b0, b1, b2)
0