結果

問題 No.451 575
ユーザー tnodinotnodino
提出日時 2023-07-09 19:04:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 16,600 KB
最終ジャッジ日時 2023-09-30 22:40:55
合計ジャッジ時間 5,956 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,828 KB
testcase_01 AC 16 ms
7,828 KB
testcase_02 AC 16 ms
8,240 KB
testcase_03 AC 15 ms
7,812 KB
testcase_04 AC 15 ms
8,128 KB
testcase_05 AC 26 ms
8,544 KB
testcase_06 AC 47 ms
8,936 KB
testcase_07 AC 195 ms
12,184 KB
testcase_08 AC 16 ms
7,912 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 312 ms
16,260 KB
testcase_14 AC 15 ms
8,084 KB
testcase_15 AC 22 ms
8,488 KB
testcase_16 AC 51 ms
9,300 KB
testcase_17 AC 235 ms
16,208 KB
testcase_18 AC 236 ms
16,208 KB
testcase_19 AC 159 ms
13,448 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 16 ms
7,880 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 16 ms
7,808 KB
testcase_26 AC 16 ms
8,100 KB
testcase_27 AC 16 ms
8,264 KB
testcase_28 AC 17 ms
8,164 KB
testcase_29 AC 38 ms
9,008 KB
testcase_30 AC 239 ms
16,600 KB
testcase_31 AC 15 ms
8,112 KB
testcase_32 AC 75 ms
9,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
b = list(int(input()) for _ in range(n))
for i in range(1,n,2):
    if b[i-1] < b[i]:
        print(-1)
        exit()
a = [1]
for i in range(n):
    if i % 2 == 0:
        a.append(b[i] - a[-1])
    else:
        a.append(a[-1] - b[i])
for i in range(n+1):
    if a[i] <= 0:
        print(-1)
        exit()
print(n+1)
for i in range(n+1):
    print(a[i])
0