結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-22 10:15:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,083 bytes |
| 記録 | |
| コンパイル時間 | 1,776 ms |
| コンパイル使用メモリ | 174,276 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 13:40:19 |
| 合計ジャッジ時間 | 3,881 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 33 WA * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
vector<string> A(H);
for(auto &&s:A)cin >> s;
for(int my = 0; my <= 50; my++){
for(int mx = 0; mx <= 50; mx++){
if(my == 0 && mx == 0)continue;
bool flag = true;
vector<vector<bool>> used(H, vector<bool>(W));
for(int y = 0; y < H; y++){
for(int x = 0; x < W; x++){
if(used[y][x])continue;
if(A[y][x] != '#')continue;
if(y + my >= H || x + mx >= W){
flag = false;
continue;
}
used[y][x] = true;
if(A[y + my][x + mx] == '#'){
used[y + my][x + mx] = true;
}else{
flag = false;
}
}
}
if(flag){
cout << "YES" << '\n';
return 0;
}
}
}
cout << "NO" << '\n';
}