結果

問題 No.1242 高橋君とすごろく
ユーザー ぷら
提出日時 2020-10-02 22:06:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 1,713 ms
コンパイル使用メモリ 177,956 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-17 13:29:39
合計ジャッジ時間 2,673 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N,K;
    cin >> N >> K;
    vector<int>A(K);
    map<int,bool>Mp;
    for(int i = 0; i < K; i++) {
        cin >> A[i];
        Mp[A[i]] = true;
    }
    bool ok = true;
    for(int i = 0; i < K; i++) {
        if(A[i]%2 == 1) {
            if(Mp[A[i]+1] || Mp[A[i]+3] || Mp[A[i]+5]) {
                ok = false;
            }
        }
    }
    cout << ((ok)?"Yes":"No") << endl;
}
0