結果

問題 No.1242 高橋君とすごろく
ユーザー abc3abc3
提出日時 2020-10-02 23:18:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 201,192 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-24 23:25:22
合計ジャッジ時間 3,210 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
#include <cstdint>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int INF=1001001001;
const int mod = 1000000007;
 
int main() {
  int64_t N,K;
  cin>>N>>K;
  vector<int64_t>A(K);
  for(int i=0;i<K;i++){
      cin>>A[i];
  }
  vector<bool>t(7,false);
  for(int i=K;i>=1;i--){
      if(A[i]==A[i-1]+1&&A[i]>=10){cout<<"No"<<endl;return 0;}
      if(A[i]==A[i-1]+5&&A[i]>=15){cout<<"No"<<endl;return 0;}
      if(A[i]==A[i-1]+3&&A[i]>=15){cout<<"No"<<endl;return 0;}
  }
  bool ok=true;
  for(int i=0;i<K;i++){
  if(A[i]==2&&A[i+1]==3){ok=false;}
  if(A[i]==3&&A[i+1]==4){ok=false;}
  if(A[i]==2&&A[i+1]==7){ok=false;}
  if(A[i]==2&&A[i+1]==5){ok=false;}
  }
  if(ok){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
  return 0;
}
0