結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー dangodango
提出日時 2023-06-24 18:39:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 91,284 KB
最終ジャッジ日時 2023-09-14 14:17:00
合計ジャッジ時間 6,227 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,384 KB
testcase_01 AC 72 ms
70,952 KB
testcase_02 AC 105 ms
85,672 KB
testcase_03 AC 91 ms
76,612 KB
testcase_04 AC 114 ms
87,484 KB
testcase_05 AC 86 ms
76,396 KB
testcase_06 AC 112 ms
89,792 KB
testcase_07 AC 96 ms
83,000 KB
testcase_08 AC 110 ms
90,760 KB
testcase_09 AC 97 ms
83,104 KB
testcase_10 AC 100 ms
84,944 KB
testcase_11 AC 115 ms
90,716 KB
testcase_12 AC 98 ms
83,736 KB
testcase_13 AC 99 ms
83,756 KB
testcase_14 AC 106 ms
89,152 KB
testcase_15 AC 101 ms
85,936 KB
testcase_16 AC 100 ms
80,304 KB
testcase_17 AC 83 ms
76,684 KB
testcase_18 AC 101 ms
80,268 KB
testcase_19 AC 96 ms
82,104 KB
testcase_20 AC 94 ms
81,440 KB
testcase_21 AC 99 ms
83,684 KB
testcase_22 AC 70 ms
71,312 KB
testcase_23 AC 71 ms
71,212 KB
testcase_24 AC 112 ms
91,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
b = list(map(int, input().split()))
a = [0] * n
for i in range(1, n):
    a[i] = a[i - 1] + b[i - 1]
for i in range(n):
    if i != 0:
        a[i] = max(a[i], a[i - 1] + d)
    print(a[i], end=' ' if i != n - 1 else '\n')
0