結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー ttrttr
提出日時 2020-06-28 15:55:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 19,688 KB
最終ジャッジ日時 2023-09-22 02:17:58
合計ジャッジ時間 4,640 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,784 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 90 ms
14,928 KB
testcase_03 AC 25 ms
9,224 KB
testcase_04 AC 92 ms
15,812 KB
testcase_05 AC 23 ms
8,876 KB
testcase_06 AC 111 ms
17,664 KB
testcase_07 AC 66 ms
13,100 KB
testcase_08 AC 119 ms
18,272 KB
testcase_09 AC 69 ms
13,304 KB
testcase_10 AC 85 ms
14,888 KB
testcase_11 AC 119 ms
18,508 KB
testcase_12 AC 73 ms
13,692 KB
testcase_13 AC 72 ms
13,580 KB
testcase_14 AC 112 ms
17,396 KB
testcase_15 AC 91 ms
15,264 KB
testcase_16 AC 50 ms
11,976 KB
testcase_17 AC 18 ms
8,604 KB
testcase_18 AC 51 ms
12,024 KB
testcase_19 AC 65 ms
13,176 KB
testcase_20 AC 60 ms
13,200 KB
testcase_21 AC 73 ms
13,704 KB
testcase_22 AC 16 ms
7,884 KB
testcase_23 AC 16 ms
7,812 KB
testcase_24 AC 116 ms
19,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int, input().split())
A = [int(a) for a in input().split()]

ans = [0]
x = 0
for a in A:
    x += a
    if x-ans[-1] < D:
        ans.append(ans[-1]+D)
        continue
    ans.append(x)

print(*ans)
0