結果

問題 No.2015 Stair Counter
ユーザー Jun MoriuchiJun Moriuchi
提出日時 2022-07-29 21:49:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 2,943 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 190,376 KB
実行使用メモリ 4,780 KB
最終ジャッジ日時 2023-09-26 20:27:28
合計ジャッジ時間 4,568 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 36 ms
4,376 KB
testcase_02 AC 40 ms
4,376 KB
testcase_03 AC 42 ms
4,376 KB
testcase_04 AC 34 ms
4,376 KB
testcase_05 AC 32 ms
4,376 KB
testcase_06 AC 47 ms
4,376 KB
testcase_07 AC 47 ms
4,380 KB
testcase_08 AC 46 ms
4,380 KB
testcase_09 AC 24 ms
4,376 KB
testcase_10 AC 26 ms
4,376 KB
testcase_11 AC 29 ms
4,380 KB
testcase_12 AC 23 ms
4,380 KB
testcase_13 AC 26 ms
4,376 KB
testcase_14 AC 30 ms
4,380 KB
testcase_15 AC 34 ms
4,376 KB
testcase_16 AC 57 ms
4,376 KB
testcase_17 AC 24 ms
4,392 KB
testcase_18 AC 50 ms
4,380 KB
testcase_19 AC 60 ms
4,688 KB
testcase_20 AC 30 ms
4,780 KB
testcase_21 AC 34 ms
4,380 KB
testcase_22 AC 39 ms
4,380 KB
testcase_23 AC 44 ms
4,380 KB
testcase_24 AC 36 ms
4,376 KB
testcase_25 AC 36 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//らせん階段
// カブト虫
// 廃墟の街
// イチジクのタルト
// カブト虫
//ドロローサへの道
// カブト虫
// 特異点
// ジョット
// エンジェル
// 紫陽花
// カブト虫
// 特異点
// 秘密の皇帝


#include <bits/stdc++.h>
#include<cmath>
#include <ext/pb_ds/assoc_container.hpp>
// tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> S;
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ld long double
#define pi pair<int,int>
#define PQ priority_queue<int>
#define PQG priority_queue<int, vector<int>, greater<int>>
#define makeVi(V,N) vector<int> (V)(N); for (int i=0;i<(N);i++) cin >>V[i];
#define vi vector<int> 
#define vld vector<long double> 
#define vs vector<string> 
#define vp vector<pi>
#define vvi(V,H,W) vector<vector<int>> (V)((H),vector<int>(W));
#define vvl(V,H,W) vector<vector<ll>> (V)((H),vector<ll>(W));
#define vvld(V,H,W) vector<vector<long double>> (V)((H),vector<long double>(W));
#define vvs(V,H,W) vector<vector<string>> (V)((H),vector<string>(W));
#define vvc(V,H,W) vector<vector<char>> (V)((H),vector<char>(W));
#define irep(n) for (int i=0; i < (n); ++i)
#define irepf1(n) for (int i=1; i <= (n); ++i)
#define jrep(n) for (int j=0; j < (n); ++j)
#define jrepf1(n) for (int j=1; j <= (n); ++j)
#define krep(n) for (int k=0; k < (n); ++k)
#define krepf1(n) for (int k=1; k <= (n); ++k)
#define rep(i,s,e) for (int (i)=(s); (i)<(e);(i)++)
#define per(i,s,e) for (int (i)=(s); (i)>=(e);(i)--)
#define PI 3.14159265358979323846264338327950288
#define Banpei 1000000000 //問題毎に設定
#define Max_V 100000
#define mod7 1000000007
#define mod9 998244353
#define eps 0.00000001
#define ALL(V,A) ((V).begin(),(V).end(),(A))
#define Find(V,X) find(V.begin(),V.end(),X)
#define Lbound(V,X) *lower_bound((V).begin(),(V).end(),(X))
#define LboundP(V,X) lower_bound((V).begin(),(V).end(),(X))-(V).begin();
#define Ubound(V,X) *upper_bound((V).begin(),(V).end(),(X))
#define UboundP(V,X) upper_bound((V).begin(),(V).end(),(X))-(V).begin();
#define Sort(V) sort((V).begin(),(V).end())
#define Reverse(V) reverse((V).begin(),(V).end())
#define Greater(V) sort((V).begin(),(V).end(),greater<int>())
#define cmin(ans,A) (ans)=min((ans),(A))
#define cmax(ans,A) (ans)=max((ans),(A))
#define AUTO(x,V) for (auto (x):(V))
#define int long long
//fixed << setprecision(10) <<

using Graph = vector<vector<int>>;
Graph makeGraph(int N, int V) {
  Graph G(N);
  irep (V) {
    int A,B;
    cin >>A>>B;
    A--;B--;
    G[A].push_back(B);
    G[B].push_back(A);
  }
  return G;
}

void solve() {
  int N,M;
  cin >>N >>M;
  vi V(N);
  irep(N) cin >>V[i];

  irep(N-1) {
    if (2*M-V[i]-V[i+1]>M) {
      cout<<"No"<<endl;
      return;
    }
  }
  cout<<"Yes"<<endl;
  return;
}

signed main() {
  int A;
  cin >>A;
  irep(A) solve();
}
0