結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー lloyzlloyz
提出日時 2022-05-14 13:05:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 10,476 KB
実行使用メモリ 19,736 KB
最終ジャッジ日時 2023-09-30 03:57:45
合計ジャッジ時間 4,991 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,784 KB
testcase_01 AC 13 ms
7,884 KB
testcase_02 AC 91 ms
14,972 KB
testcase_03 AC 24 ms
9,256 KB
testcase_04 AC 91 ms
15,932 KB
testcase_05 AC 18 ms
8,856 KB
testcase_06 AC 103 ms
17,660 KB
testcase_07 AC 65 ms
13,144 KB
testcase_08 AC 122 ms
18,260 KB
testcase_09 AC 68 ms
13,248 KB
testcase_10 AC 81 ms
14,728 KB
testcase_11 AC 111 ms
18,348 KB
testcase_12 AC 70 ms
13,664 KB
testcase_13 AC 69 ms
13,612 KB
testcase_14 AC 111 ms
17,380 KB
testcase_15 AC 92 ms
15,180 KB
testcase_16 AC 49 ms
11,808 KB
testcase_17 AC 17 ms
8,300 KB
testcase_18 AC 45 ms
11,684 KB
testcase_19 AC 61 ms
13,104 KB
testcase_20 AC 56 ms
13,176 KB
testcase_21 AC 71 ms
13,660 KB
testcase_22 AC 13 ms
7,784 KB
testcase_23 AC 13 ms
7,872 KB
testcase_24 AC 114 ms
19,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
A = list(map(int, input().split()))

ANS = [0]
for i in range(n - 1):
    ANS.append(ANS[-1] + A[i])
for i in range(1, n):
    dis = ANS[i] - ANS[i - 1]
    if dis < d:
        ANS[i] += d - dis
print(*ANS)
0