結果

問題 No.2015 Stair Counter
ユーザー atjh16
提出日時 2022-07-23 07:17:59
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 2,408 ms
コンパイル使用メモリ 193,256 KB
最終ジャッジ日時 2025-01-30 13:14:47
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int t, n;
long long m;

int main()
{
	cin >> t;

	for (int i = 0; i < t; i++) {
		cin >> n >> m;

		vector<long long> a(n);
		bool f = 0;

		for (int j = 0; j < n; j++) {
			cin >> a[j];

			if (j > 0 && a[j - 1] + a[j] < m)
				f = 1;
		}

		if(f)
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
}
0