結果
問題 | No.179 塗り分け |
ユーザー | CleyL |
提出日時 | 2022-09-21 13:36:01 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,696 bytes |
コンパイル時間 | 923 ms |
コンパイル使用メモリ | 95,680 KB |
実行使用メモリ | 147,316 KB |
最終ジャッジ日時 | 2023-08-23 19:56:35 |
合計ジャッジ時間 | 10,902 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 13 ms
6,460 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 23 ms
29,420 KB |
testcase_09 | WA | - |
testcase_10 | AC | 1,373 ms
147,316 KB |
testcase_11 | AC | 1,131 ms
125,580 KB |
testcase_12 | AC | 1,109 ms
126,040 KB |
testcase_13 | AC | 1 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,380 KB |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 1 ms
4,376 KB |
testcase_17 | AC | 1 ms
4,380 KB |
testcase_18 | AC | 277 ms
53,984 KB |
testcase_19 | AC | 249 ms
50,972 KB |
testcase_20 | AC | 2 ms
4,376 KB |
testcase_21 | AC | 2 ms
4,380 KB |
testcase_22 | AC | 30 ms
29,608 KB |
testcase_23 | AC | 92 ms
38,300 KB |
testcase_24 | AC | 25 ms
29,076 KB |
testcase_25 | AC | 27 ms
29,228 KB |
testcase_26 | WA | - |
testcase_27 | AC | 152 ms
41,248 KB |
testcase_28 | WA | - |
testcase_29 | AC | 336 ms
55,696 KB |
testcase_30 | WA | - |
testcase_31 | AC | 440 ms
64,564 KB |
testcase_32 | AC | 555 ms
74,752 KB |
testcase_33 | AC | 558 ms
72,560 KB |
testcase_34 | WA | - |
testcase_35 | AC | 660 ms
84,640 KB |
testcase_36 | AC | 1 ms
4,376 KB |
testcase_37 | AC | 2 ms
4,376 KB |
testcase_38 | AC | 1 ms
4,380 KB |
testcase_39 | AC | 2 ms
4,380 KB |
testcase_40 | AC | 2 ms
4,376 KB |
testcase_41 | AC | 1 ms
4,376 KB |
testcase_42 | AC | 1 ms
4,380 KB |
testcase_43 | AC | 5 ms
4,376 KB |
testcase_44 | AC | 24 ms
8,668 KB |
testcase_45 | AC | 2 ms
4,376 KB |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <map> using namespace std; struct d{ int a,b,c; bool operator<(d x){ if(a == x.a){ if(b == x.b){ return c < x.c; } return b < x.b; } return a < x.a; } bool operator==(d x){ return a==x.a && b==x.b && c==x.c; } bool operator>(d x){ return !((*this) < x || (*this) == x); } }; 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 || c==0){ cout << "NO" << endl; return 0; } int C = 0; set<pair<int,int>> X[h*w]; vector<d> ZZ; 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; int tmp = (i-k)*w+(j-l)+h*w; ZZ.push_back({tmp,(i-k),(j-l)}); if(i==k && j==l)continue; if(A[i][j] == '#' && A[k][l] == '#'){ //cout << i-k << " " << j-l << endl; if(!X[tmp].count({i,j}) && !X[tmp].count({k,l})){ X[(i-k)*w+(j-l)+h*w].insert({i,j}); X[(i-k)*w+(j-l)+h*w].insert({k,l}); } } } } } } //sort(ZZ.begin(),ZZ.end()); //ZZ.erase(unique(ZZ.begin(),ZZ.end()),ZZ.end()); //for(int i = 0; ZZ.size() > i; i++){ // cout << ZZ[i].a << " " << ZZ[i].b << " " << ZZ[i].c << endl; //} for(int i = 0; h*w > i; i++){ if(X[i].size() == c){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; }