結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー matriematrie
提出日時 2020-12-19 22:50:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 21,600 KB
最終ジャッジ日時 2023-10-21 09:40:29
合計ジャッジ時間 4,095 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,092 KB
testcase_01 AC 31 ms
10,092 KB
testcase_02 AC 118 ms
17,060 KB
testcase_03 AC 41 ms
11,132 KB
testcase_04 AC 119 ms
17,820 KB
testcase_05 AC 39 ms
10,820 KB
testcase_06 AC 126 ms
19,576 KB
testcase_07 AC 92 ms
14,824 KB
testcase_08 AC 159 ms
20,244 KB
testcase_09 AC 97 ms
14,968 KB
testcase_10 AC 115 ms
16,812 KB
testcase_11 AC 143 ms
20,396 KB
testcase_12 AC 99 ms
15,540 KB
testcase_13 AC 98 ms
15,544 KB
testcase_14 AC 147 ms
19,304 KB
testcase_15 AC 121 ms
17,220 KB
testcase_16 AC 71 ms
13,448 KB
testcase_17 AC 34 ms
10,396 KB
testcase_18 AC 67 ms
14,132 KB
testcase_19 AC 90 ms
14,712 KB
testcase_20 AC 85 ms
14,324 KB
testcase_21 AC 99 ms
15,552 KB
testcase_22 AC 30 ms
10,092 KB
testcase_23 AC 31 ms
10,092 KB
testcase_24 AC 138 ms
21,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
l=list(map(int,input().split()))+[0]
p=[0]
for i in range(n-1):
	if l[i]<d: 
		l[i+1]-=d-l[i]
		l[i]=d
	p.append(p[i]+l[i])
print(*p)
0