結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー tomoyaatcodertomoyaatcoder
提出日時 2020-08-01 17:10:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 95,348 KB
最終ジャッジ日時 2023-09-22 11:03:12
合計ジャッジ時間 5,085 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,064 KB
testcase_01 AC 72 ms
71,488 KB
testcase_02 AC 106 ms
88,556 KB
testcase_03 AC 86 ms
76,776 KB
testcase_04 AC 110 ms
90,532 KB
testcase_05 AC 86 ms
76,868 KB
testcase_06 AC 113 ms
93,068 KB
testcase_07 AC 101 ms
84,692 KB
testcase_08 AC 120 ms
94,520 KB
testcase_09 AC 102 ms
84,872 KB
testcase_10 AC 107 ms
87,396 KB
testcase_11 AC 117 ms
94,848 KB
testcase_12 AC 103 ms
85,652 KB
testcase_13 AC 103 ms
85,632 KB
testcase_14 AC 114 ms
92,700 KB
testcase_15 AC 107 ms
88,768 KB
testcase_16 AC 94 ms
81,052 KB
testcase_17 AC 84 ms
76,832 KB
testcase_18 AC 97 ms
81,644 KB
testcase_19 AC 99 ms
83,936 KB
testcase_20 AC 97 ms
82,936 KB
testcase_21 AC 104 ms
85,592 KB
testcase_22 AC 72 ms
71,352 KB
testcase_23 AC 74 ms
71,248 KB
testcase_24 AC 118 ms
95,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def accumulate(a):
    n = len(a)
    ret = [0 for i in range(n + 1)]
    for i in range(1, n + 1):
        ret[i] = ret[i - 1] + a[i - 1]
    return ret
    
N, D = map(int, input().split())
a = list(map(int, input().split()))

positions = accumulate(a)
for i in range(1, N):
    gap = positions[i] - positions[i - 1]
    if gap < D:
        positions[i] = positions[i - 1] + D
print(*positions)
0