結果

問題 No.2015 Stair Counter
ユーザー 沙耶花
提出日時 2022-07-22 21:23:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 527 bytes
コンパイル時間 4,848 ms
コンパイル使用メモリ 253,116 KB
最終ジャッジ日時 2025-01-30 11:55:50
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000



int main(){
	
	int _t;
	cin>>_t;
	
	rep(_,_t){
		long long N,M;
		cin>>N>>M;
		
		vector<long long> a(N);
		rep(i,N)cin>>a[i];
		a.insert(a.begin(),M);
		bool f = true;
		rep(i,a.size()-2){
			if(a[i+1]+a[i+2]<a[i]){
				f = false;
			}
		}
		if(f)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
    return 0;
}
0