結果
問題 | No.2922 Rose Garden |
ユーザー | hibit_at |
提出日時 | 2024-10-12 14:57:45 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,032 bytes |
コンパイル時間 | 1,081 ms |
コンパイル使用メモリ | 109,592 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-10-12 14:57:54 |
合計ジャッジ時間 | 4,415 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | AC | 41 ms
5,248 KB |
testcase_16 | AC | 52 ms
5,248 KB |
testcase_17 | AC | 70 ms
6,144 KB |
testcase_18 | AC | 6 ms
5,248 KB |
testcase_19 | AC | 33 ms
5,248 KB |
testcase_20 | AC | 49 ms
5,248 KB |
testcase_21 | AC | 70 ms
5,888 KB |
testcase_22 | AC | 40 ms
5,248 KB |
testcase_23 | AC | 63 ms
5,888 KB |
testcase_24 | AC | 12 ms
5,248 KB |
testcase_25 | AC | 33 ms
5,248 KB |
testcase_26 | AC | 51 ms
5,248 KB |
testcase_27 | AC | 57 ms
5,504 KB |
testcase_28 | AC | 52 ms
5,248 KB |
testcase_29 | AC | 46 ms
5,248 KB |
testcase_30 | AC | 5 ms
5,248 KB |
testcase_31 | AC | 3 ms
5,248 KB |
testcase_32 | AC | 4 ms
5,248 KB |
testcase_33 | AC | 3 ms
5,248 KB |
testcase_34 | AC | 5 ms
5,248 KB |
testcase_35 | AC | 4 ms
5,248 KB |
testcase_36 | AC | 8 ms
5,248 KB |
testcase_37 | AC | 10 ms
5,248 KB |
testcase_38 | AC | 5 ms
5,248 KB |
testcase_39 | AC | 7 ms
5,248 KB |
testcase_40 | AC | 45 ms
5,248 KB |
testcase_41 | AC | 24 ms
5,248 KB |
testcase_42 | AC | 73 ms
6,272 KB |
testcase_43 | AC | 31 ms
5,248 KB |
testcase_44 | AC | 70 ms
5,888 KB |
testcase_45 | AC | 15 ms
5,248 KB |
testcase_46 | AC | 74 ms
6,272 KB |
testcase_47 | AC | 50 ms
5,248 KB |
testcase_48 | AC | 13 ms
5,248 KB |
testcase_49 | AC | 61 ms
5,888 KB |
testcase_50 | AC | 2 ms
5,248 KB |
testcase_51 | AC | 2 ms
5,248 KB |
testcase_52 | AC | 2 ms
5,248 KB |
ソースコード
#include <algorithm> #include <iostream> #include <iomanip> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #include <stack> #include <complex> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n + 1; i++) #define rev(i, n) for (int i = n - 1; i >= 0; i--) #define all(A) A.begin(), A.end() #define itr(A, l, r) A.begin() + l, A.begin() + r #define debug(var) cout << #var << " = " << var << endl; typedef long long ll; template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << "," << p.second << ")"; return os; } template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i] << (i + 1 != (int)v.size() ? " " : ""); } return os; } template <typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i] << endl; } return os; } template <typename T> ostream &operator<<(ostream &os, const vector<vector<vector<T>>> &v) { int n = v.size(); int m = v[0].size(); int p = v[0][0].size(); rep(k, p) { os << "k = " << k << endl; rep(i, n) { rep(j, m) { os << v[i][j][k]; if (j < m - 1) { os << " "; } else { os << endl; } } } } return os; } template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; } template <typename T, typename S> ostream &operator<<(ostream &os, map<T, S> &mp) { for (auto &[key, val] : mp) { os << key << ":" << val << " "; } cout << endl; return os; } template <typename T> ostream &operator<<(ostream &os, set<T> st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; } template <typename T> ostream &operator<<(ostream &os, multiset<T> st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; } template <typename T> ostream &operator<<(ostream &os, queue<T> q) { while (q.size()) { os << q.front() << " "; q.pop(); } return os; } template <typename T> ostream &operator<<(ostream &os, deque<T> q) { while (q.size()) { os << q.front() << " "; q.pop_front(); } return os; } template <typename T> ostream &operator<<(ostream &os, stack<T> st) { while (st.size()) { os << st.top() << " "; st.pop(); } return os; } template <typename T> ostream &operator<<(ostream &os, priority_queue<T> pq) { while (pq.size()) { os << pq.top() << " "; pq.pop(); } return os; } template <typename T> ostream &operator<<(ostream &os, priority_queue<T, vector<T>, greater<T>> mpq) { while (mpq.size()) { os << mpq.top() << " "; mpq.pop(); } return os; } int main(){ ll n,s,b; cin >> n >> s >> b; vector<ll> dp(n); dp[0] = s*b; vector<ll> h(n); cin >> h; // debug(dp); rep(i,n-1){ ll dif = h[i+1] - h[i]; if(dif > dp[i]){ cout << "No" << endl; return 0; } else{ ll restart = h[i+1] + s*b; dp[i+1] = max(dp[i],restart); } // debug(dp); } cout << "Yes" << endl; }