結果

問題 No.451 575
ユーザー compass19compass19
提出日時 2016-12-08 23:22:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-05-09 19:16:23
合計ジャッジ時間 7,488 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 33 ms
10,624 KB
testcase_04 AC 32 ms
10,624 KB
testcase_05 AC 45 ms
11,008 KB
testcase_06 AC 73 ms
11,392 KB
testcase_07 AC 259 ms
14,464 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 457 ms
14,720 KB
testcase_14 AC 31 ms
10,624 KB
testcase_15 AC 40 ms
10,752 KB
testcase_16 AC 68 ms
11,264 KB
testcase_17 AC 257 ms
14,720 KB
testcase_18 AC 258 ms
14,720 KB
testcase_19 AC 180 ms
13,312 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 32 ms
10,624 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 32 ms
10,752 KB
testcase_26 AC 31 ms
10,752 KB
testcase_27 AC 33 ms
10,624 KB
testcase_28 AC 33 ms
10,624 KB
testcase_29 AC 55 ms
11,008 KB
testcase_30 AC 249 ms
14,720 KB
testcase_31 AC 32 ms
10,752 KB
testcase_32 AC 105 ms
12,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


for index, elm in enumerate(b):
	if index == 0:
		begin = 1
		end = elm - begin
		key = elm
	elif index%2:
		key = key - elm
		end = min(end, key-1)
	else:
		key = elm - key
		end = min(end, elm - key)
	if end < begin:
		print(-1)
		exit()

print(n+1)
for index, elm in enumerate(b):
	if index == 0:
		key = begin
		print(key)
		key = elm - key
		print(key)
		continue
	if index%2:
		key = key - elm
		print(key)
	else:
		key = elm - key
		print(key)
0