結果

問題 No.1941 CHECKER×CHECKER(1)
ユーザー a
提出日時 2022-05-21 07:40:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 674 bytes
コンパイル時間 2,105 ms
コンパイル使用メモリ 197,292 KB
最終ジャッジ日時 2025-01-29 12:44:13
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    char S[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> S[i][j];
        }
    }
    set<char> s1, s2;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            if ((i + j) % 2 == 0) {
                s1.insert(S[i][j]);
            } else {
                s2.insert(S[i][j]);
            }
        }
    }
    if ((int)(s1.size()) == 1 && (int)(s2.size()) == 1 && (S[0][0] != S[0][1])) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}
0