結果

問題 No.2015 Stair Counter
ユーザー srjywrdnprkt
提出日時 2023-05-13 05:57:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 985 ms
コンパイル使用メモリ 106,540 KB
最終ジャッジ日時 2025-02-12 23:51:54
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

void solve(){
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    for (int i=0; i<N; i++) cin >> A[i];
    for (int i=0; i<N-1; i++){
        if (A[i]+A[i+1] < M){
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

int main(){

    int T;
    cin >> T;
    while(T){
        T--;
        solve();
    }

    return 0;
}
0