結果

問題 No.2922 Rose Garden
ユーザー kakao745kakao745
提出日時 2024-10-12 18:34:18
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 77 ms / 3,000 ms
コード長 3,560 bytes
コンパイル時間 3,011 ms
コンパイル使用メモリ 253,420 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 18:34:25
合計ジャッジ時間 6,781 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
5,248 KB
testcase_01 AC 28 ms
5,248 KB
testcase_02 AC 43 ms
5,248 KB
testcase_03 AC 75 ms
5,248 KB
testcase_04 AC 44 ms
5,248 KB
testcase_05 AC 39 ms
5,248 KB
testcase_06 AC 27 ms
5,248 KB
testcase_07 AC 62 ms
5,248 KB
testcase_08 AC 14 ms
5,248 KB
testcase_09 AC 66 ms
5,248 KB
testcase_10 AC 23 ms
5,248 KB
testcase_11 AC 15 ms
5,248 KB
testcase_12 AC 45 ms
5,248 KB
testcase_13 AC 57 ms
5,248 KB
testcase_14 AC 12 ms
5,248 KB
testcase_15 AC 42 ms
5,248 KB
testcase_16 AC 52 ms
5,248 KB
testcase_17 AC 72 ms
5,248 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 68 ms
5,248 KB
testcase_22 AC 39 ms
5,248 KB
testcase_23 AC 64 ms
5,248 KB
testcase_24 AC 12 ms
5,248 KB
testcase_25 AC 35 ms
5,248 KB
testcase_26 AC 52 ms
5,248 KB
testcase_27 AC 57 ms
5,248 KB
testcase_28 AC 51 ms
5,248 KB
testcase_29 AC 44 ms
5,248 KB
testcase_30 AC 5 ms
5,248 KB
testcase_31 AC 2 ms
5,248 KB
testcase_32 AC 4 ms
5,248 KB
testcase_33 AC 2 ms
5,248 KB
testcase_34 AC 6 ms
5,248 KB
testcase_35 AC 4 ms
5,248 KB
testcase_36 AC 8 ms
5,248 KB
testcase_37 AC 9 ms
5,248 KB
testcase_38 AC 5 ms
5,248 KB
testcase_39 AC 8 ms
5,248 KB
testcase_40 AC 46 ms
5,248 KB
testcase_41 AC 23 ms
5,248 KB
testcase_42 AC 73 ms
5,248 KB
testcase_43 AC 33 ms
5,248 KB
testcase_44 AC 71 ms
5,248 KB
testcase_45 AC 15 ms
5,248 KB
testcase_46 AC 77 ms
5,248 KB
testcase_47 AC 50 ms
5,248 KB
testcase_48 AC 14 ms
5,248 KB
testcase_49 AC 64 ms
5,248 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
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define itn int
#define rep(i,n) for(long long i=0;i<(long long)n;i++)
#define reps(i,n) for(long long i=1;i<=(long long)n;i++)
#define repi(i,n) for(int i=0;i<(int)n;i++)
#define loop(i,l,r) for(long long i=l;i<=(long long)r;i++)
#define drep(i,n) for(long long i=(long long)n-1;i>=0;i--)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define yn(x) cout << (x? "Yes":"No") << endl;
#define cou(x) cout << x << endl;
#define emp emplace_back
#pragma GCC target ("avx,avx2")//四則演算
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")//ループ
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")//浮動小数点
const long long mod=998244353LL;
const long long mods=1000000007LL;
const double inf=numeric_limits<double>::infinity();
const int kaz=1000000000;
const long long yab=2500000000000000000LL;
const long long aho =-yab;
const long double eps=1.0e-14L;
const long double pi=acosl(-1.0L);
using ll=long long;
using st=string;
using P=pair<ll,ll>;
using tup=tuple<ll,ll,ll>;
using vi=vector<ll>;
using vin=vector<int>;
using vc=vector<char>;
using vb=vector<bool>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using sp=set<P>;
using si=set<ll>;
using vvi=vector<vector<ll>>;
using vvin=vector<vin>;
using vvc=vector<vc>;
using vvb=vector<vb>;
using vvvi=vector<vvi>;
using vvvin=vector<vvin>;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const vector<int> ex = {-1, -1, -1, 0, 0, 1, 1, 1};
const vector<int> ey = {-1, 0, 1, -1, 1, -1, 0, 1};
template<typename T>istream&operator>>(istream&is,vector<T>&v){for(T&in:v)is>>in;return is;}
template<typename T>ostream&operator<<(ostream&os,vector<T>v){rep(i,v.size())os<<v[i]<<(i+1!=v.size()?" ":"\n");return os;}
template<typename T1,typename T2>
void co(bool x,T1 y,T2 z){
  if(x)cout << y << endl;
  else cout << z << endl;
}
template<typename T>
bool chmax(T &a, T b){
	if(a<b){
		a=b;
		return true;
	}
	return false;
}
template <typename T, typename U>
T ceil(T x, U y) {
  return (x > 0 ? (x + y - 1) / y : x / y);
}

template <typename T, typename U>
T floor(T x, U y) {
  return (x > 0 ? x / y : (x - y + 1) / y);
}
template<typename T>
bool chmin(T &a, T b){
	if(a>b){
		a=b;
		return true;
	}
	return false;
}
template<typename T>
void print(vector<T> &a){
	for(int i=0;i<a.size();i++){
		cout << a[i];
		if(i==(long long)a.size()-1)cout << endl;
		else cout << " ";
	}
}
template<typename T>
void her(vector<T> &a){
  for(auto &g:a)g--;
}
vector<long long> fac,finv,invs;
// テーブルを作る前処理
void COMinit(int MAX,int MOD) {
	fac.resize(MAX);
	finv.resize(MAX);
	invs.resize(MAX);
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    invs[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        invs[i] = MOD - invs[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * invs[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k,int MOD){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll mypow(ll x,ll y){
	ll ret=1;
	while(y>0){
		if(y&1)ret=ret*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return ret;
}
ll nopow(ll x,ll y){
	ll ret=1;
	while(y>0){
		if(y&1)ret*=x;
		x*=x;
		y>>=1;
	}
	return ret;
}

int main(){
	cin.tie(nullptr);
	int n,s,b;
	cin >> n >> s >> b;
	vi h(n);
	cin >> h;
	bool kaz=true;
	ll maxi=-1;
	rep(i,n-1){
		maxi=max(maxi,h[i]);
		if((h[i+1]-maxi+b-1)/b>=s+1){
			kaz=false;
		}
	}
	yn(kaz)
}
0