結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー nohakai3nohakai3
提出日時 2022-07-22 13:55:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 212 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 19,672 KB
最終ジャッジ日時 2023-09-16 22:18:15
合計ジャッジ時間 4,297 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,752 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 112 ms
14,996 KB
testcase_03 AC 27 ms
9,268 KB
testcase_04 AC 108 ms
15,804 KB
testcase_05 AC 25 ms
8,940 KB
testcase_06 AC 120 ms
17,600 KB
testcase_07 AC 82 ms
14,052 KB
testcase_08 AC 150 ms
17,912 KB
testcase_09 AC 86 ms
13,448 KB
testcase_10 AC 106 ms
14,596 KB
testcase_11 AC 132 ms
18,388 KB
testcase_12 AC 91 ms
13,648 KB
testcase_13 AC 89 ms
13,592 KB
testcase_14 AC 141 ms
17,432 KB
testcase_15 AC 116 ms
15,268 KB
testcase_16 AC 60 ms
11,872 KB
testcase_17 AC 19 ms
8,444 KB
testcase_18 AC 55 ms
12,136 KB
testcase_19 AC 81 ms
13,304 KB
testcase_20 AC 75 ms
13,304 KB
testcase_21 AC 91 ms
13,608 KB
testcase_22 AC 16 ms
7,792 KB
testcase_23 AC 16 ms
7,788 KB
testcase_24 AC 128 ms
19,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
A=list(map(int,input().split()))
l=[0]
a=0
for i in range(n-1):
    a+=A[i]
    l.append(a)

for i in range(len(l)-1):
    if l[i+1]-l[i]<m:
        l[i+1]+=m-(l[i+1]-l[i])

print(*l)
0