結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー na-shna-sh
提出日時 2020-07-07 18:45:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,740 KB
最終ジャッジ日時 2024-04-09 03:08:20
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 136 ms
17,396 KB
testcase_03 AC 43 ms
11,648 KB
testcase_04 AC 138 ms
17,456 KB
testcase_05 AC 41 ms
11,392 KB
testcase_06 AC 158 ms
18,876 KB
testcase_07 AC 102 ms
15,516 KB
testcase_08 AC 178 ms
19,236 KB
testcase_09 AC 107 ms
15,552 KB
testcase_10 AC 130 ms
17,108 KB
testcase_11 AC 173 ms
19,576 KB
testcase_12 AC 109 ms
15,916 KB
testcase_13 AC 109 ms
15,604 KB
testcase_14 AC 167 ms
18,604 KB
testcase_15 AC 138 ms
17,132 KB
testcase_16 AC 78 ms
14,264 KB
testcase_17 AC 35 ms
11,008 KB
testcase_18 AC 77 ms
14,032 KB
testcase_19 AC 101 ms
15,392 KB
testcase_20 AC 93 ms
15,408 KB
testcase_21 AC 111 ms
15,816 KB
testcase_22 AC 30 ms
10,752 KB
testcase_23 AC 30 ms
10,752 KB
testcase_24 AC 172 ms
20,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


x = [0] * N
for i, n in enumerate(a):
    x[i+1] = x[i] + n

for i in range(N-1):
    if x[i+1] - x[i] < D:
        x[i+1] = x[i] + D
print(*x)
0