結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 16 ms
7,908 KB
testcase_02 AC 15 ms
8,108 KB
testcase_03 AC 15 ms
7,760 KB
testcase_04 AC 15 ms
8,252 KB
testcase_05 AC 28 ms
8,696 KB
testcase_06 AC 55 ms
9,740 KB
testcase_07 AC 232 ms
17,480 KB
testcase_08 AC 16 ms
7,876 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 305 ms
15,948 KB
testcase_14 AC 15 ms
8,216 KB
testcase_15 AC 23 ms
8,392 KB
testcase_16 AC 49 ms
9,392 KB
testcase_17 AC 231 ms
15,940 KB
testcase_18 AC 225 ms
15,888 KB
testcase_19 AC 154 ms
13,400 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 15 ms
7,928 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 15 ms
7,928 KB
testcase_26 AC 15 ms
8,236 KB
testcase_27 AC 16 ms
8,192 KB
testcase_28 AC 17 ms
8,180 KB
testcase_29 AC 36 ms
8,964 KB
testcase_30 AC 229 ms
16,664 KB
testcase_31 AC 15 ms
8,104 KB
testcase_32 AC 88 ms
11,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
b = list(int(input()) for _ in range(n))
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