結果

問題 No.1242 高橋君とすごろく
ユーザー chocono2230chocono2230
提出日時 2020-10-02 23:06:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,430 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 209,568 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-24 22:57:36
合計ジャッジ時間 3,946 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  set<ll> se;
  ll n;
  int k;
  cin >> n >> k;
  vector<ll> in(k);
  rep(i, k) cin >> in.at(i);
  sort(ALL(in));
  int mode = -1;
  for(auto now : in){
    se.insert(now);
    rep(i, 3){
      if(se.find(now-1-2*i) != se.end()){
        // cerr << i << endl;
        if(mode != -1 && i != 0){
          cout << "No" << endl;
          return 0;
        }else{
          mode = i;
          int m = -1;
          if(mode == 0){
            se.insert(now-4);
            se.insert(now-6);
            m = (now-1) % 6;
          }else if(mode == 1){
            se.insert(now-5);
            se.insert(now-6);
            m = now % 6;
          }else{
            if(now > 6){
              m %= 6;
            }
            else m = -1;
          }
          if(m == 0 || m-3 == 0 || m-5 == 0){
            cout << "No" << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
0