結果

問題 No.1941 CHECKER×CHECKER(1)
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-06-29 11:45:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 200,308 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 07:09:41
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 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,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){

    int dx[4] = {1, 0, -1, 0};
    int dy[4] = {0, 1, 0, -1};
    int nh, nw;
    bool f=1;

    vector<string> S(3);
    for (int i=0; i<3; i++) cin >> S[i];

    for (int h=0; h<3; h++){
        for (int w=0; w<3; w++){
            for (int i=0; i<4; i++){
                nh = h+dx[i];
                nw = w+dy[i];
                if (nh < 0 || nh >= 3 || nw < 0 || nw >= 3) continue;
                if (S[h][w] == S[nh][nw]) f=0;
            }
        }
    }

    cout << (f ? "Yes" : "No") << endl;

    return 0;
}
0