結果

問題 No.2922 Rose Garden
ユーザー ReidReid
提出日時 2024-10-12 14:44:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 4,157 bytes
コンパイル時間 2,395 ms
コンパイル使用メモリ 189,084 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 14:44:20
合計ジャッジ時間 4,830 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
5,248 KB
testcase_01 AC 10 ms
5,248 KB
testcase_02 AC 15 ms
5,248 KB
testcase_03 AC 25 ms
5,248 KB
testcase_04 AC 16 ms
5,248 KB
testcase_05 AC 14 ms
5,248 KB
testcase_06 AC 9 ms
5,248 KB
testcase_07 AC 21 ms
5,248 KB
testcase_08 AC 6 ms
5,248 KB
testcase_09 AC 22 ms
5,248 KB
testcase_10 AC 8 ms
5,248 KB
testcase_11 AC 6 ms
5,248 KB
testcase_12 AC 16 ms
5,248 KB
testcase_13 AC 20 ms
5,248 KB
testcase_14 AC 5 ms
5,248 KB
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 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 5 ms
5,248 KB
testcase_38 WA -
testcase_39 AC 4 ms
5,248 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 2 ms
5,248 KB
testcase_51 AC 2 ms
5,248 KB
testcase_52 AC 2 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
using namespace std;
using namespace __gnu_pbds;

#define rep(i,n) for(int i = 0;i<(n);i++)
#define per(i,n) for(int i = (n-1);i>=0;i--)
#define nfor(i,b,e) for(int i = b;i<(e);i++)
#define Sort(a) sort((a).begin(), (a).end())
#define Rev(a) reverse((a).begin(), (a).end())
#define all(...) std::begin(__VA_ARGS__), std::end(__VA_ARGS__)
#define rall(...) std::rbegin(__VA_ARGS__), std::rend(__VA_ARGS__)//reverseしてからall
#define endl '\n'
#define YesNo(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#include <limits>
// Tu は最大値のある符号無し整数型 (型チェックに必要な static_assert などは省略)
template <typename Tu>
static inline constexpr bool is_multiplication_safe(Tu a, Tu b){
    return !a || b <= std::numeric_limits<Tu>::max() / a;
}

template <typename Tu>
static inline constexpr bool is_addition_safe(Tu a, Tu b){
    if(a*b <= 0) return true;
    else if(a<0 && b<0) return b >= std::numeric_limits<Tu>::max() - a;
    else if(a>0 && b>0) return b <= std::numeric_limits<Tu>::max() - a;
}

//O(NlogN)の計算量が必要
template <typename T>
double median(std::vector<T> numbers) {

    std::sort(numbers.begin(), numbers.end());

    size_t size = numbers.size();
    if (size % 2 == 0) return (numbers[size / 2 - 1] + numbers[size / 2]) / 2.0;
    else return numbers[size / 2];
}

#ifdef _DEBUG
//vectorの要素を列挙
#define debug(x) cout<<#x<<": "<<x<<'\n'
template <typename T>
void debugv(const vector<T>& vec) {
    for (const auto& element : vec) cout << element << " ";
    cout << endl;
}

//2次元vectorの要素を列挙
template <typename T>
void debugvv(const vector<vector<T>>& vec) {
    for (const auto& e1 : vec) {
        for(const auto& e2:e1) cout << e2 << " ";
        cout << endl;
    }
    cout << endl;
}
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#endif

typedef long long ll;
typedef unsigned long long ull;
//<int>を<使いたい型>に書き変える
//*orderd_set.find_by_order(i)で値を取得する。
using  ordered_set =  tree<char, null_type, less<char>, rb_tree_tag, tree_order_statistics_node_update>;
using vi = vector<int>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvvi = vector<vector<vector<int>>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using Pii = pair<int,int>;
#define make(x,y) make_pair(x,y)

//vector to string
string to_string(vector<int> a){
    int n = a.size();
    string res = "";
    rep(i,n) res += char(a[i]+'0');
    return res;
}

long double euclid_dist(long double xi,long double yi,long double xj,long double yj){
    return sqrt((xi-xj)*(xi-xj)+(yi-yj)*(yi-yj));
}

ull factorial(int n){
    if(n==0||n==1) return 1ULL;
    else return factorial(n-1)*n;
}

template<int MOD>
struct ModInt {
	static const int Mod = MOD;
	unsigned x;
	ModInt() : x(0) { }
	ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }

	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
};
using mint =  ModInt<1000000007>;


int main(){
    ios::sync_with_stdio(false);
	cin.tie(nullptr);
    //dpだろ!
    int n,s,b;cin >> n >> s >>b;
    vi h(n); rep(i,n)cin >> h[i];
    //着地すると回復する?
    //n==1に気を付けたい
    if(n==1) YesNo(true);
    vi diff(n-1); rep(i,n-1) diff[i] = h[i+1]-h[i];
    bool ans = true;
    rep(i,n-1) if(diff[i]>s*b) ans = false;
    YesNo(ans); 
    return 0;
}
0