結果

問題 No.1242 高橋君とすごろく
ユーザー 👑 tute7627tute7627
提出日時 2020-07-05 19:39:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,255 bytes
コンパイル時間 2,463 ms
コンパイル使用メモリ 200,376 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 12:11:13
合計ジャッジ時間 3,536 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

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]--;
  }
  ll mi=INF;
  rep(i,0,k-1){
    assert(a[i]<a[i+1]);
    chmin(mi,a[i+1]-a[i]);
  }
  cout<<mi<<endl;
  bool judge=false;
  rep(i,0,k)rep(j,i+1,k){
    ll d=a[j]-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