結果

問題 No.179 塗り分け
ユーザー CleyLCleyL
提出日時 2022-09-21 13:16:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 989 bytes
コンパイル時間 868 ms
コンパイル使用メモリ 89,332 KB
実行使用メモリ 136,316 KB
最終ジャッジ日時 2023-08-23 19:55:20
合計ジャッジ時間 13,813 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 11 ms
5,576 KB
testcase_07 WA -
testcase_08 AC 4 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1,943 ms
136,316 KB
testcase_11 AC 1,650 ms
116,248 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 AC 302 ms
36,684 KB
testcase_19 AC 261 ms
34,076 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 WA -
testcase_23 AC 72 ms
14,924 KB
testcase_24 WA -
testcase_25 AC 8 ms
4,544 KB
testcase_26 WA -
testcase_27 AC 149 ms
21,500 KB
testcase_28 WA -
testcase_29 AC 381 ms
38,348 KB
testcase_30 WA -
testcase_31 AC 514 ms
48,200 KB
testcase_32 AC 668 ms
58,860 KB
testcase_33 AC 618 ms
56,400 KB
testcase_34 WA -
testcase_35 AC 854 ms
68,176 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 1 ms
4,380 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 4 ms
4,380 KB
testcase_44 AC 21 ms
7,164 KB
testcase_45 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <map>
using namespace std;
int main(){
  int h,w;cin>>h>>w;
  vector<vector<char>> A(h,vector<char>(w));
  int c = 0;
  for(int i = 0; h > i; i++){
    for(int j = 0; w > j; j++){
      cin>>A[i][j];
      if(A[i][j] == '#')c++;
    }
  }
  if(c%2){
    cout << "NO" << endl;
    return 0;
  }
  int C = 0;
  set<pair<int,int>> X[2*h*w];
  for(int i = 0; h > i; i++){
    for(int j = 0; w > j; j++){
      for(int k = i; h > k; k++){
        for(int l = j; w > l; l++){
          //cout << (i-k)*w+(j-l)+h*w << endl;
          if(i==k && j==l)continue;
          if(A[i][j] == '#' && A[k][l] == '#'){
            //cout << i-k << " " << j-l << endl;
            X[(i-k)*w+(j-l)+h*w].insert({i,j});
            X[(i-k)*w+(j-l)+h*w].insert({k,l});
          }
        }
      }
    }
  }
  for(int i = 0; 2*h*w > i; i++){
    if(X[i].size() == c){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
0