結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー syunsukesyunsuke
提出日時 2020-11-02 21:45:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 87,356 KB
実行使用メモリ 108,004 KB
最終ジャッジ日時 2023-09-29 13:48:45
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,080 KB
testcase_01 AC 71 ms
71,236 KB
testcase_02 AC 114 ms
95,696 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 85 ms
76,804 KB
testcase_06 WA -
testcase_07 AC 103 ms
89,156 KB
testcase_08 WA -
testcase_09 AC 108 ms
90,160 KB
testcase_10 AC 111 ms
94,124 KB
testcase_11 WA -
testcase_12 AC 108 ms
90,796 KB
testcase_13 WA -
testcase_14 AC 125 ms
103,320 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 86 ms
76,916 KB
testcase_18 WA -
testcase_19 AC 104 ms
88,432 KB
testcase_20 AC 102 ms
86,448 KB
testcase_21 AC 107 ms
91,640 KB
testcase_22 AC 71 ms
71,308 KB
testcase_23 AC 72 ms
71,416 KB
testcase_24 AC 126 ms
108,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
L=[0]+list(map(int,input().split()))
P=[0]
for i in range(1,N):
    P.append(P[-1]+L[i])
#print(P)
ans=[0]
for i in range(1,N):
    A=(ans[-1]+max(D,L[i]))
    #print(A)
    if P[i]>=A:
        ans.append(P[i])
    else:
        ans.append(min(A,ans[-1]+D))
print(*ans)
0