結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー futago0118futago0118
提出日時 2020-07-09 23:03:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,720 KB
最終ジャッジ日時 2024-04-17 04:52:48
合計ジャッジ時間 4,465 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 129 ms
17,296 KB
testcase_03 AC 43 ms
11,648 KB
testcase_04 AC 135 ms
17,336 KB
testcase_05 AC 36 ms
11,392 KB
testcase_06 AC 166 ms
18,880 KB
testcase_07 AC 100 ms
15,528 KB
testcase_08 AC 174 ms
19,244 KB
testcase_09 AC 104 ms
15,584 KB
testcase_10 AC 129 ms
17,108 KB
testcase_11 AC 173 ms
19,580 KB
testcase_12 AC 112 ms
15,808 KB
testcase_13 AC 108 ms
15,632 KB
testcase_14 AC 167 ms
18,484 KB
testcase_15 AC 141 ms
17,144 KB
testcase_16 AC 79 ms
13,776 KB
testcase_17 AC 33 ms
11,008 KB
testcase_18 AC 77 ms
14,032 KB
testcase_19 AC 102 ms
15,404 KB
testcase_20 AC 92 ms
15,408 KB
testcase_21 AC 108 ms
15,800 KB
testcase_22 AC 27 ms
10,752 KB
testcase_23 AC 26 ms
10,752 KB
testcase_24 AC 171 ms
20,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
A = [int(x) for x in input().split()]

P = [0]*N
for i in range(1,N):
    P[i] = P[i-1] + A[i-1] 
    
#print(P)

for i in range(N-1):
    d = P[i+1] - P[i]
    if d < D:
        P[i+1] = P[i] + D

print(*P)
0