結果
問題 |
No.2922 Rose Garden
|
ユーザー |
![]() |
提出日時 | 2024-10-12 14:41:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 3,000 ms |
コード長 | 757 bytes |
コンパイル時間 | 2,866 ms |
コンパイル使用メモリ | 246,440 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 14:41:33 |
合計ジャッジ時間 | 5,028 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, x, y) for (auto i = (x); i < (y); i++) #define RREP(i, x, y) for (auto i = (y) - 1; (x) <= i; i--) #define ALL(x) (x).begin(), (x).end() #pragma GCC optimize("O3") template<class T> bool chmax(T &a, const T b){ if(a < b){ a = b; return true; } return false; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll N, S, B; cin >> N >> S >> B; vector<ll> H(N); REP(i, 0, N){ cin >> H[i]; } ll ma = H[0]; REP(i, 1, N){ if(ma + S * B < H[i]){ cout << "No\n"; return 0; } chmax(ma, H[i]); } cout << "Yes\n"; return 0; } /* File : ~/yukicoder/midoriika_3rd/D.cpp Date : 2024/10/12 Time : 14:37:49 */