結果

問題 No.1242 高橋君とすごろく
ユーザー totori_nyaatotori_nyaa
提出日時 2020-10-02 22:28:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 830 bytes
コンパイル時間 2,097 ms
コンパイル使用メモリ 206,404 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-24 21:35:01
合計ジャッジ時間 3,300 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
ll dx[4]={0,1,-1,0};
ll dy[4]={1,0,0,-1};



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);


    ll n,k;
    cin>>n>>k;
    ll a[k];
    map<ll,ll> mp;
    for(int i=0;i<k;i++){
        cin>>a[i];
        mp[a[i]] = 1;
    }
    bool pos = 1;
    for(int i=0;i<k;i++){
        for(int d=1;d<=6;d++){
            ll now = a[i] - d;
            if(now<=0)continue;
            ll nx = now + 7 - d;
            if(mp.count(nx) && min(a[i],nx)%2)pos=false;
        }
    }
    if(pos)cout << "Yes\n";
    else cout << "No\n";
}
0