結果
| 問題 | 
                            No.179 塗り分け
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-08-08 20:01:47 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,442 bytes | 
| コンパイル時間 | 3,445 ms | 
| コンパイル使用メモリ | 232,912 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-19 16:43:40 | 
| 合計ジャッジ時間 | 5,017 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 6 | 
| other | AC * 34 WA * 6 | 
ソースコード
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <cmath>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define frep(i,a,b) for (int i = (a); i <= (b); ++i)
#define all(x) (x).begin(),(x).end()
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define debug(x) cout << #x << ": " << x << endl;
typedef long long ll;
using P = pair<ll,ll>;
using P2 = pair<ll,P>;
using mint = modint1000000007;
#define INF 1001001001
#define LINF (1LL<<60)
#define F first
#define S second
template<class T> inline bool chmax(T& a, T b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b){ if(a>b){ a=b; return 1; } return 0; }
int main() {
  int h, w; cin >> h >> w;
  vector<string> s(h);
  rep(i, h) cin >> s[i];
  vector<string> f;
  bool ans = false, ok;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (i+j == 0) continue;
      f = s;
      ok = true;
      rep(k,h) {
        rep(l, w) {
          if (f[k][l] == '#') {
            if (k+i > h-1 || l+j > w-1 || f[k+i][l+j] != '#') {
              ok = false;
              break;
            } else {
              f[k+i][l+j] = '.';
            }
          }
        }
      }
      if (ok) ans = true;
    }
  }
  if (ans) puts("YES");
  else puts("NO");
  
}