結果

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[110];
int main() {
    long long n, k;
    cin >> n >> k;
    for (int i = 0; i < k; i++) {
        cin >> a[i];
    }
    bool b = false, b1 = false;
    bool b2 = false, b3 = false;
    bool b4 = false, b5 = false;
    for (int i = 0; i < k; i++) {
        if (b1 && a[i] % 6 == 0) {
            b = true;
        }
        if (a[i] % 6 == 1) {
            b1 = true;
        }
        if (a[i] % 6 == 2) {
            b2 = true;
        }
        if (a[i] % 6 == 3) {
            b3 = true;
        }
        if (b3 && a[i] % 6 == 4) {
            b4 = true;
        }
        if (b2 && a[i] % 6 == 5) {
            b5 = true;
        }
    }
    if (b || b4 || b5) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }
    return 0;
}
0