結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2020-09-24 22:48:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 779 bytes |
コンパイル時間 | 1,795 ms |
コンパイル使用メモリ | 198,224 KB |
最終ジャッジ日時 | 2025-01-14 20:10:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 39 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++) #define REP(i, n) FOR(i,0,n) template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; } int main() { int H, W; cin >> H >> W; vector<string> S(H); cin >> S; REP(dx, H) for (int dy = -W + 1; dy < W; dy++) if (dx or dy) { auto T = S; bool f = true; REP(i, H) REP(j, W) if (T[i][j] == '#') { if (i + dx >= H or j + dy >= W or j + dy < 0 or T[i + dx][j + dy] == '.') f = false; else T[i + dx][j + dy] = '.'; } if (f) { puts("YES"); return 0; } } puts("NO"); }