結果

問題 No.2922 Rose Garden
コンテスト
ユーザー miya145592
提出日時 2024-10-12 14:51:26
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 69 ms / 3,000 ms
+ 224µs
コード長 386 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 83 ms
コンパイル使用メモリ 64,360 KB
実行使用メモリ 85,084 KB
最終ジャッジ日時 2026-11-02 01:53:38
合計ジャッジ時間 6,125 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 53
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline
N, S, B = map(int, input().split())
H = list(map(int, input().split()))
now_s = S
now_h = H[0]
for i in range(N-1):
    if now_s>0:
        now_h += now_s*B
        now_s = 0
    if H[i]+S*B>now_h:
        now_h = H[i]
        now_s = S
        now_h += now_s*B
        now_s = 0
    if now_h<H[i+1]:
        print("No")
        exit()
print("Yes")
0