結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー arito_asu
提出日時 2020-07-01 16:18:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 26,844 KB
最終ジャッジ日時 2024-09-14 02:25:44
合計ジャッジ時間 4,522 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

q=lambda:map(int,input().split())
n,d=q(); a=list(q())

nl = [0]

for i in a:
    nl.append(nl[-1] + i)
    
for j in range(len(nl)-1):
    dif = nl[j+1] - nl[j]
    if dif < d:
        nl[j+1] += (d-dif)

print(' '.join(map(str,nl)))
0