結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー trineutrontrineutron
提出日時 2020-06-24 07:04:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 19,588 KB
最終ジャッジ日時 2023-09-16 20:43:36
合計ジャッジ時間 3,780 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,776 KB
testcase_01 AC 15 ms
7,840 KB
testcase_02 AC 110 ms
14,992 KB
testcase_03 AC 29 ms
9,140 KB
testcase_04 AC 125 ms
15,864 KB
testcase_05 AC 24 ms
8,756 KB
testcase_06 AC 154 ms
17,620 KB
testcase_07 AC 83 ms
13,372 KB
testcase_08 AC 155 ms
18,144 KB
testcase_09 AC 87 ms
13,292 KB
testcase_10 AC 106 ms
14,780 KB
testcase_11 AC 162 ms
18,432 KB
testcase_12 AC 91 ms
13,624 KB
testcase_13 AC 90 ms
13,588 KB
testcase_14 AC 146 ms
17,232 KB
testcase_15 AC 115 ms
15,188 KB
testcase_16 AC 60 ms
11,924 KB
testcase_17 AC 18 ms
8,428 KB
testcase_18 AC 63 ms
11,772 KB
testcase_19 AC 81 ms
13,148 KB
testcase_20 AC 73 ms
13,232 KB
testcase_21 AC 90 ms
13,696 KB
testcase_22 AC 15 ms
7,852 KB
testcase_23 AC 15 ms
7,756 KB
testcase_24 AC 163 ms
19,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
a = list(map(int, input().split()))
s = [0] * n
for i in range(1, n):
    s[i] = s[i - 1] + a[i - 1]
for i in range(1, n):
    s[i] = max(s[i], s[i - 1] + d)
print(*s)
0