結果
| 問題 |
No.2015 Stair Counter
|
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-08-22 16:33:28 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| コード長 | 1,426 bytes |
| コンパイル時間 | 1,384 ms |
| コンパイル使用メモリ | 116,032 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-10 06:37:38 |
| 合計ジャッジ時間 | 3,351 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include <iostream>
#include<utility>
#include <vector>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#define pb push_back
#define all(x) begin(x),end(x)
#define gall(x) begin(x),end(x),greater<>()
#define ll long long
#define P pair<int,int>
#define lP pair<ll,ll>
#include <iostream>
#include <vector>
using namespace std;
vector<pair<long long, long long> > prime_factorize(long long N) {
vector<pair<long long, long long> > res;
for (long long p = 2; p * p <= N; ++p) {
if (N % p != 0) {
continue;
}
int e = 0;
while (N % p == 0) {
++e;
N /= p;
}
res.emplace_back(p, e);
}
if (N != 1) {
res.emplace_back(N, 1);
}
return res;
}
struct UnionFind{
vector<int> p;
UnionFind(int n){
p.resize(n,-1);
}
int find(int x){
if(p[x]== -1) return x;
else return find(p[x]);
}
void unite(int x,int y){
x=find(x);
y=find(y);
if(x==y) return;
p[x]=y;
}
};
int main() {
int t;
cin>>t;
for(int i=0;i<t;i++){
int n,m;
cin>>n>>m;
bool f=1;
vector<int> a(n);
for(int j=0;j<n;j++){
cin>>a[j];
}
for(int j=0;j<n-1;j++){
if(a[j]+a[j+1]<m) f=0;
}
if(f) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
sorag