結果
| 問題 |
No.179 塗り分け
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2018-07-10 17:12:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 552 bytes |
| コンパイル時間 | 2,111 ms |
| コンパイル使用メモリ | 198,480 KB |
| 最終ジャッジ日時 | 2025-01-06 11:54:55 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 5 |
| other | AC * 10 WA * 1 RE * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int H, W; cin>>H>>W;
vector<string> S(H); for(auto& e: S) cin>>e;
#define REP(i, a, b) for(int i=a; i<b; ++i)
REP(r, 0, H) REP(c, 0, W) if (c|r) {
auto T=S;
REP(i, -H, H) REP(j, -W, W) if (0<=i+r && i+r<H && 0<=j+c && j+c<W)
if (T[i][j] && S[i][j]==S[i+r][j+c]) T[i][j]=T[i+r][j+c]=0;
int no=0;
REP(i, 0, H) REP(j, 0, W)
no|=T[i][j] && S[i][j]=='#';
if (!no) return !printf("YES\n");
}
puts("NO");
}
hogeover30