結果

問題 No.1941 CHECKER×CHECKER(1)
ユーザー nao109
提出日時 2022-10-11 00:56:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 1,972 ms
コンパイル使用メモリ 194,332 KB
最終ジャッジ日時 2025-02-08 01:18:56
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define all(a) a.begin(),a.end()
int main(){
  vector<string> s(3);
  for(int i=0; i<3; ++i) cin >> s[i];
  bool flag=true;
  for(int i=0; i<3; ++i)for(int j=0; j<3; ++j){
    if(j>0){
      if(s[i][j]==s[i][j-1]) flag=false;
    }
    if(j<2){
      if(s[i][j]==s[i][j+1]) flag=false;
    }
    if(i>0){
      if(s[i][j]==s[i-1][j]) flag=false;
    }
    if(i<2){
      if(s[i][j]==s[i+1][j]) flag=false;
    }
  }
  if(flag) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}
0