結果

問題 No.451 575
ユーザー matsu7874matsu7874
提出日時 2016-12-02 00:40:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 19,888 KB
最終ジャッジ日時 2023-08-22 11:56:19
合計ジャッジ時間 5,803 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 15 ms
8,096 KB
testcase_03 AC 15 ms
7,808 KB
testcase_04 AC 15 ms
8,240 KB
testcase_05 AC 25 ms
8,380 KB
testcase_06 AC 47 ms
8,868 KB
testcase_07 AC 189 ms
12,088 KB
testcase_08 AC 15 ms
7,824 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 327 ms
19,888 KB
testcase_14 AC 16 ms
8,132 KB
testcase_15 AC 21 ms
8,392 KB
testcase_16 AC 43 ms
8,732 KB
testcase_17 AC 188 ms
12,016 KB
testcase_18 AC 188 ms
12,016 KB
testcase_19 AC 131 ms
10,684 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 16 ms
7,792 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 15 ms
7,804 KB
testcase_26 AC 15 ms
8,052 KB
testcase_27 AC 15 ms
8,252 KB
testcase_28 AC 18 ms
8,224 KB
testcase_29 AC 33 ms
8,596 KB
testcase_30 AC 185 ms
12,132 KB
testcase_31 AC 15 ms
8,240 KB
testcase_32 AC 75 ms
9,304 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)

print(a)
print(b)
0