結果
問題 | No.2015 Stair Counter |
ユーザー | cpbm_p |
提出日時 | 2022-07-22 21:53:50 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,557 bytes |
コンパイル時間 | 3,203 ms |
コンパイル使用メモリ | 220,032 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 06:09:11 |
合計ジャッジ時間 | 4,735 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 10 ms
6,940 KB |
testcase_14 | AC | 11 ms
6,940 KB |
testcase_15 | AC | 13 ms
6,940 KB |
testcase_16 | AC | 20 ms
6,940 KB |
testcase_17 | AC | 11 ms
6,940 KB |
testcase_18 | AC | 17 ms
6,940 KB |
testcase_19 | AC | 21 ms
6,940 KB |
testcase_20 | AC | 14 ms
6,944 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
ソースコード
#ifndef LOCAL #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,fma,abm,mmx,avx,avx2") #include <bits/stdc++.h> #else #include <stdc++.h> #endif // ---------- BEGIN : ac-library ---------- insert/ to enable /* #include <atcoder/all> // ac-library using namespace atcoder; // ac-library std::ostream &operator<<(std::ostream &os, const modint998244353 &a) {return os<<a.val();} std::ostream &operator<<(std::ostream &os, const modint1000000007 &a) {return os<<a.val();} //*/ // ---------- END : ac-library ---------- using namespace std; using ll = long long; using ld = long double; template<class T> using V = vector<T>; template<class T, class U> using P = pair<T,U>; template<class T> using max_heap = priority_queue<T>; template<class T> using min_heap = priority_queue<T,vector<T>,greater<T>>; #define OVERLOADER(_1,_2,_3,NAME,...) NAME #define REP2(i,a,b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i,n) REP2(i,0,n) #define rep(...) OVERLOADER(__VA_ARGS__,REP2,REP)(__VA_ARGS__) #define pb push_back #define eb emplace_back #define ALL(a) a.begin(),a.end() #define RALL(a) a.rbegin(),a.rend() template<class T, class U> inline bool chmin(T &a, U b) { if(a>b) {a=b; return 1;} return 0;} template<class T, class U> inline bool chmax(T &a, U b) { if(a<b) {a=b; return 1;} return 0;} inline ll max (ll lhs, ll rhs) {return std::max<ll>(lhs, rhs);} inline ll min (ll lhs, ll rhs) {return std::min<ll>(lhs, rhs);} template<class T>inline void uniqify(V<T>& v){v.erase(unique(ALL(v)),v.end());} template<class T>V<T>compress(V<T> &v){V<T>vals=v;sort(ALL(vals));uniqify(vals);rep(i,v.size())v[i]=lower_bound(ALL(vals),v[i])-vals.begin();return vals;} template<class T> istream& operator>>(istream& is,V<T>& v){for(T& e:v) is>>e; return is;} template<class T,class U> istream& operator>>(istream& is,P<T,U>& p){return is>>p.first>>p.second;} template<class T> ostream& operator<<(ostream& os,V<T>& v) {int ss=v.size(); rep(ii,ss) {os<<v[ii]<<(ii+1==ss?"":" ");} return os;} template<class T> ostream& operator<<(ostream& os,set<T>& v) {for(auto va:v) {os<<va<<' ';} return os;} template<class T,class U> ostream& operator<<(ostream& os,P<T,U>& p){return os<<p.first<<' '<<p.second;} template<class T>inline void drop(const T& x) { cout << x << endl; exit(0); } #ifdef LOCAL void debug_out() { cerr << endl; } template <class Head, class... Tail> void debug_out(Head H, Tail... T) { cerr << ", " << H; debug_out(T...); } #define debug(...) cerr << "Line " << __LINE__ << " : " << #__VA_ARGS__ << " ,,", debug_out(__VA_ARGS__) #else #define debug(...) (void(0)) #endif constexpr char ENDL = '\n'; inline void yesno(bool f) { cout << (f ? "Yes" : "No") << ENDL; } constexpr ll INF = (1LL<<30)-1; // 問題毎にfit constexpr ll INFLL = (1LL<<62)-1; // 問題毎にfit const ld PI = acos(static_cast<long double>(-1.0)); constexpr int dy[]={0, 1, 0, -1}; constexpr int dx[]={1, 0, -1, 0}; // constexpr int dy[]={0, 1, 1, 1, 0, -1, -1, -1}; // constexpr int dx[]={1, 1, 0, -1, -1, -1, 0, 1}; struct FIO{FIO(){cin.tie(nullptr);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(15);}}fio; // using mint = modint1000000007; // using mint = modint998244353; int main() { int t; cin>>t; while(t--) { int n,m; cin>>n>>m; V<int> a(n); cin>>a; bool ok = true; for(int i=2; i<n; i++) { if(a[i-2] + a[i-1] < a[i]) ok = false; } if(a[0] + a[1] < m) ok = false; yesno(ok); } }