結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー Theta
提出日時 2022-10-20 11:14:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 523 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 49,800 KB
最終ジャッジ日時 2024-06-30 05:13:54
合計ジャッジ時間 14,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
from numpy import diff


def main():
    N, D = map(int, input().split())
    others = accumulate(map(int, input().split()))
    moved = [0]

    for person in others:
        if person - moved[-1] < D:
            moved.append(moved[-1] + D)
        else:
            moved.append(person)
    print(*moved)


if __name__ == "__main__":
    main()
0