結果

問題 No.1242 高橋君とすごろく
ユーザー 👑 tute7627tute7627
提出日時 2020-07-05 19:23:05
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,189 bytes
コンパイル時間 2,027 ms
コンパイル使用メモリ 202,504 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-27 08:24:58
合計ジャッジ時間 3,158 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define rep(i,n,m) for(int i = (n); i < (int)(m); i++)
#define rrep(i,n,m) for(int i = (m) - 1; i >= (int)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const int INF = (int)1e9+1;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
template<typename T>
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
int main(){
  ll n,k;cin>>n>>k;
  assert(n>=1&&n<=(ll)1e18);
  assert(k>=1&&k<=100);
  vector<ll>a(k);
  rep(i,0,k){
    cin>>a[i];
    assert(a[i]>=2&&a[i]<n);
    a[i]--;
  }
  rep(i,0,k-1){
    assert(a[i]<a[i+1]);
  }
  bool judge=false;
  rep(i,0,k-1){
    ll d=a[i+1]-a[i];
    if(a[i]>=20&&(d==1||d==3||d==5))judge=true;
  }
  ll sz=100;
  vector<bool>t(sz);
  rep(i,0,k)if(a[i]<sz)t[a[i]]=true;
  rrep(i,0,sz-10){
    rep(j,1,4){
      if(t[i+j]&&t[i+7-j])t[i]=true;
    }
  }
  if(judge||t[0])cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  return 0;
}
0