結果

問題 No.2922 Rose Garden
ユーザー Basin-BugBasin-Bug
提出日時 2024-10-12 15:10:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 117,656 KB
最終ジャッジ日時 2024-10-12 15:10:58
合計ジャッジ時間 6,220 ms
ジャッジサーバーID
(参考情報)
judge / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 50 ms
68,992 KB
testcase_31 AC 49 ms
64,000 KB
testcase_32 AC 49 ms
66,304 KB
testcase_33 AC 48 ms
63,360 KB
testcase_34 AC 63 ms
69,760 KB
testcase_35 AC 49 ms
65,280 KB
testcase_36 AC 50 ms
72,960 KB
testcase_37 AC 57 ms
78,668 KB
testcase_38 AC 49 ms
67,840 KB
testcase_39 AC 51 ms
72,448 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 34 ms
52,224 KB
testcase_51 AC 34 ms
52,096 KB
testcase_52 AC 35 ms
52,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, S, B = map(int, input().split())
H = list(map(int, input().split()))


high = H[0]
for i in range(1, N):
  high += B * S
  if high < H[i]:
    ans = False
    break
  high = H[i]
else:
  ans = True

dp = [[-1] * 2 for i in range(N)]
dp[0][1] = H[0]
for i in range(N - 1):
  if max(dp[i]) < H[i]:
    print("No")
    break
  dp[i + 1][0] = dp[i][0]
  if dp[i][1] == H[i]:
    dp[i + 1][0] = max(dp[i + 1][0], dp[i][1] + B * S)
  if dp[i + 1][0] >= H[i + 1]:
    dp[i + 1][1] = H[i + 1]
  if dp[i + 1][1] != H[i + 1]:
    if dp[i][1] + B * S >= H[i + 1]:
      dp[i + 1][1] = H[i + 1]

if ans and max(dp[-1]) >= H[-1]:
  print("Yes")
else:
  print("No")
0