結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー ThetaTheta
提出日時 2022-10-20 11:14:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 40,272 KB
最終ジャッジ日時 2023-09-12 17:23:21
合計ジャッジ時間 6,266 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
29,260 KB
testcase_01 AC 135 ms
29,204 KB
testcase_02 AC 190 ms
36,864 KB
testcase_03 AC 142 ms
30,528 KB
testcase_04 AC 194 ms
37,608 KB
testcase_05 AC 140 ms
30,016 KB
testcase_06 AC 208 ms
39,560 KB
testcase_07 AC 174 ms
34,244 KB
testcase_08 AC 215 ms
40,232 KB
testcase_09 AC 176 ms
34,920 KB
testcase_10 AC 187 ms
36,320 KB
testcase_11 AC 215 ms
40,272 KB
testcase_12 AC 179 ms
35,252 KB
testcase_13 AC 181 ms
35,200 KB
testcase_14 AC 212 ms
39,132 KB
testcase_15 AC 192 ms
37,084 KB
testcase_16 AC 162 ms
32,976 KB
testcase_17 AC 135 ms
29,548 KB
testcase_18 AC 161 ms
32,892 KB
testcase_19 AC 171 ms
34,388 KB
testcase_20 AC 166 ms
34,016 KB
testcase_21 AC 180 ms
35,380 KB
testcase_22 AC 135 ms
29,292 KB
testcase_23 AC 136 ms
29,240 KB
testcase_24 AC 215 ms
40,124 KB
権限があれば一括ダウンロードができます

ソースコード

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