結果

問題 No.451 575
ユーザー matsu7874matsu7874
提出日時 2016-12-02 00:42:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 1,042 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 15,968 KB
最終ジャッジ日時 2023-08-22 11:58:51
合計ジャッジ時間 6,271 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,812 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
8,096 KB
testcase_03 AC 15 ms
7,820 KB
testcase_04 AC 15 ms
8,096 KB
testcase_05 AC 25 ms
8,392 KB
testcase_06 AC 49 ms
8,900 KB
testcase_07 AC 191 ms
11,952 KB
testcase_08 AC 16 ms
7,808 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 293 ms
15,968 KB
testcase_14 AC 16 ms
8,100 KB
testcase_15 AC 21 ms
8,368 KB
testcase_16 AC 42 ms
8,836 KB
testcase_17 AC 184 ms
11,996 KB
testcase_18 AC 187 ms
12,028 KB
testcase_19 AC 129 ms
10,688 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 15 ms
7,880 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 15 ms
7,748 KB
testcase_26 AC 16 ms
8,036 KB
testcase_27 AC 16 ms
8,308 KB
testcase_28 AC 17 ms
8,224 KB
testcase_29 AC 33 ms
8,596 KB
testcase_30 AC 193 ms
11,940 KB
testcase_31 AC 15 ms
8,064 KB
testcase_32 AC 73 ms
9,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
b = [int(input()) for i in range(n)]

if b[0] == 1:
    print(-1)

a = [1]
for i in range(n):
    if i%2 == 0:
        a.append(b[i] - a[i])
    elif i%2 == 1:
        a.append(a[i] - b[i])
    if a[-1] <= 0:
        print(-1)
        exit()

print(n+1)
for v in a:
    print(v)
0