結果

問題 No.40 多項式の割り算
ユーザー Yuta123456Yuta123456
提出日時 2020-05-21 17:54:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 686 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-09 23:26:42
合計ジャッジ時間 27,746 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 703 ms
10,752 KB
testcase_01 AC 703 ms
10,752 KB
testcase_02 AC 372 ms
10,752 KB
testcase_03 AC 733 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 776 ms
10,880 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 769 ms
11,008 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 768 ms
10,880 KB
testcase_22 AC 742 ms
10,880 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 716 ms
10,752 KB
testcase_26 AC 720 ms
10,752 KB
testcase_27 AC 759 ms
10,880 KB
testcase_28 AC 745 ms
10,752 KB
testcase_29 AC 717 ms
10,752 KB
testcase_30 AC 782 ms
10,752 KB
testcase_31 AC 722 ms
10,880 KB
testcase_32 AC 712 ms
10,752 KB
testcase_33 AC 725 ms
10,752 KB
testcase_34 AC 756 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
array = list(map(int, input().split()))
c = array[0]
f_1 = sum(array)
f_2 = 0
for i in range(d+1):
    if i % 2 == 0:
        f_2 += array[i]
    else:
        f_2 -= array[i]
for a in range(-1000, 1000):
    for b in range(-1000,1000):
        if a+b+c == f_1 and a-b+c == f_2:
            d = 3
            if a == 0:
                d -= 1
                if b == 0:
                    d -= 1
                    if c == 0:
                        d -= 1
            if d == 0:
                print(0)
                print(0)
                exit()
            print(d-1)
            for i in range(d):
                print([c,b,a][i], end=" ")
            break
0