結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー pete1288998pete1288998
提出日時 2020-06-27 01:03:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 19,652 KB
最終ジャッジ日時 2023-09-18 12:42:33
合計ジャッジ時間 4,401 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 16 ms
7,952 KB
testcase_02 AC 110 ms
15,064 KB
testcase_03 AC 27 ms
9,060 KB
testcase_04 AC 116 ms
15,884 KB
testcase_05 AC 24 ms
8,900 KB
testcase_06 AC 132 ms
17,648 KB
testcase_07 AC 82 ms
12,936 KB
testcase_08 AC 153 ms
18,304 KB
testcase_09 AC 88 ms
13,140 KB
testcase_10 AC 107 ms
15,000 KB
testcase_11 AC 147 ms
18,432 KB
testcase_12 AC 92 ms
13,516 KB
testcase_13 AC 90 ms
13,548 KB
testcase_14 AC 145 ms
17,476 KB
testcase_15 AC 114 ms
15,332 KB
testcase_16 AC 59 ms
11,540 KB
testcase_17 AC 18 ms
8,348 KB
testcase_18 AC 58 ms
11,544 KB
testcase_19 AC 81 ms
12,888 KB
testcase_20 AC 73 ms
12,724 KB
testcase_21 AC 92 ms
13,552 KB
testcase_22 AC 15 ms
7,764 KB
testcase_23 AC 16 ms
7,764 KB
testcase_24 AC 144 ms
19,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d = map(int,input().split())

a = list(map(int,input().split()))

dist = [0]

for i in range(n-1):
    dist.append(dist[i]+a[i])
    
for i in range(1,n):
    if dist[i] - dist[i-1] < d:
        dist[i] = dist[i-1] + d
        
for i in dist:
    print(i, end=" ")
0