結果
問題 |
No.179 塗り分け
|
ユーザー |
|
提出日時 | 2025-05-07 16:42:03 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,233 bytes |
コンパイル時間 | 1,067 ms |
コンパイル使用メモリ | 90,344 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-05-07 16:42:06 |
合計ジャッジ時間 | 3,210 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 33 WA * 7 |
ソースコード
// competitive-verifier: PROBLEM https://yukicoder.me/problems/no/0179 #include <iostream> #include <string> #include <vector> int main(void) { int h, w; std::cin >> h >> w; std::vector<std::string> b(h); for (auto &s : b) std::cin >> s; int c = 0; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { c += b[i][j] == '#'; } } if (c == 0) { std::cout << "NO\n"; } bool ans = false; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i == 0 && j == 0) continue; bool f = true; std::vector dp(h, std::vector(w, -1)); for (int x = 0; x < h; ++x) { for (int y = 0; y < w; ++y) { if (b[x][y] == '#') { if (dp[x][y] == 1) continue; if (i + x < h && j + y < w && b[i + x][j + y] == '#') dp[i + x][j + y] = 1; else f = false; } } } ans |= f; } } std::cout << (ans ? "YES\n" : "NO\n"); return 0; }