結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー arito_asuarito_asu
提出日時 2020-07-01 16:18:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 24,448 KB
最終ジャッジ日時 2023-10-12 02:39:29
合計ジャッジ時間 3,853 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,988 KB
testcase_01 AC 15 ms
7,876 KB
testcase_02 AC 89 ms
17,912 KB
testcase_03 AC 24 ms
9,456 KB
testcase_04 AC 92 ms
19,212 KB
testcase_05 AC 23 ms
8,984 KB
testcase_06 AC 105 ms
21,652 KB
testcase_07 AC 68 ms
14,972 KB
testcase_08 AC 121 ms
22,448 KB
testcase_09 AC 71 ms
15,236 KB
testcase_10 AC 85 ms
17,228 KB
testcase_11 AC 117 ms
22,992 KB
testcase_12 AC 75 ms
16,148 KB
testcase_13 AC 74 ms
15,800 KB
testcase_14 AC 115 ms
21,668 KB
testcase_15 AC 93 ms
18,500 KB
testcase_16 AC 50 ms
12,744 KB
testcase_17 AC 18 ms
8,360 KB
testcase_18 AC 48 ms
12,920 KB
testcase_19 AC 66 ms
14,760 KB
testcase_20 AC 60 ms
14,020 KB
testcase_21 AC 73 ms
16,204 KB
testcase_22 AC 16 ms
7,860 KB
testcase_23 AC 16 ms
7,872 KB
testcase_24 AC 116 ms
24,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

q=lambda:map(int,input().split())
n,d=q(); a=list(q())

nl = [0]

for i in a:
    nl.append(nl[-1] + i)
    
for j in range(len(nl)-1):
    dif = nl[j+1] - nl[j]
    if dif < d:
        nl[j+1] += (d-dif)

print(' '.join(map(str,nl)))
0