結果

問題 No.179 塗り分け
ユーザー ttakanottakano
提出日時 2017-11-18 01:56:52
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 929 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 148,796 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-16 19:16:56
合計ジャッジ時間 5,554 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 4 ms
4,376 KB
testcase_06 RE -
testcase_07 WA -
testcase_08 AC 27 ms
4,384 KB
testcase_09 AC 27 ms
4,380 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 1 ms
4,380 KB
testcase_14 RE -
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 27 ms
4,380 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 27 ms
4,376 KB
testcase_27 AC 27 ms
4,376 KB
testcase_28 AC 27 ms
4,380 KB
testcase_29 AC 27 ms
4,380 KB
testcase_30 AC 27 ms
4,376 KB
testcase_31 AC 27 ms
4,376 KB
testcase_32 AC 27 ms
4,376 KB
testcase_33 AC 27 ms
4,380 KB
testcase_34 AC 27 ms
4,380 KB
testcase_35 AC 27 ms
4,380 KB
testcase_36 RE -
testcase_37 AC 1 ms
4,376 KB
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 2 ms
4,384 KB
testcase_40 AC 1 ms
4,380 KB
testcase_41 AC 1 ms
4,384 KB
testcase_42 AC 1 ms
4,376 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 5 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 100000000000;

using namespace std;

int main() {
  int h,w;
  cin>>h>>w;
  vector<string> s(h);
  string ans="NO";
  bool flag=true;
  REP(i,h){
    cin>>s[i];
  }
  for(int i=-h;i<h;i++){
    for(int j=-w;j<w;j++){
      if(i==0&&j==0)continue;
      auto c=s;
      flag=true;
      for(int k=0;k<h;k++){
        for(int l=0;l<w;l++){
          if(s[k][l]=='#'&&c[k][l]=='#'){
            int nk=i+k;
            int nl=j+l;
            if(nk<0||nk>h||nl>w||nl<0||s[k][l]!=s[nk][nl]){
              goto stop;
            }
            c[k][l]=c[nk][nl]='.';
          }
        }
      }
      ans="YES";
      stop:;
    }
  }
  print(ans);
  return 0;
}
0