結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー Cer0un0Cer0un0
提出日時 2020-07-04 23:00:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 1,066 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 98,976 KB
最終ジャッジ日時 2023-10-19 18:38:26
合計ジャッジ時間 4,182 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,360 KB
testcase_01 AC 37 ms
53,360 KB
testcase_02 AC 77 ms
89,728 KB
testcase_03 AC 51 ms
66,496 KB
testcase_04 AC 81 ms
92,868 KB
testcase_05 AC 49 ms
64,444 KB
testcase_06 AC 85 ms
95,892 KB
testcase_07 AC 69 ms
84,800 KB
testcase_08 AC 88 ms
98,316 KB
testcase_09 AC 70 ms
85,360 KB
testcase_10 AC 75 ms
88,628 KB
testcase_11 AC 91 ms
98,640 KB
testcase_12 AC 71 ms
86,196 KB
testcase_13 AC 71 ms
86,196 KB
testcase_14 AC 84 ms
95,592 KB
testcase_15 AC 78 ms
90,596 KB
testcase_16 AC 59 ms
77,228 KB
testcase_17 AC 49 ms
64,444 KB
testcase_18 AC 61 ms
78,756 KB
testcase_19 AC 67 ms
84,012 KB
testcase_20 AC 66 ms
82,700 KB
testcase_21 AC 71 ms
86,460 KB
testcase_22 AC 37 ms
53,388 KB
testcase_23 AC 36 ms
53,388 KB
testcase_24 AC 90 ms
98,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

N, D = map(int, input().split())
A = list(map(int, input().split()))

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

print(*Ret)

0