結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
aqua_tenhou
|
| 提出日時 | 2021-06-20 22:31:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 607 ms / 3,000 ms |
| コード長 | 797 bytes |
| コンパイル時間 | 405 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 77,480 KB |
| 最終ジャッジ日時 | 2024-06-22 22:41:32 |
| 合計ジャッジ時間 | 10,035 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 40 |
ソースコード
h,w = map(int,input().split())
s = [list(input()) for i in range(h)]
c = 0
for x in s: c += x.count("#")
if c == 0:
print("NO")
exit()
for i in range(h+1):
for j in range(-w, w+1):
use = [[0 for _ in range(w)] for __ in range(h)]
if i == j == 0: continue
flg = True
for x in range(h):
for y in range(w):
if s[x][y] == "#" and use[x][y] == 0:
if 0 <= x+i < h and 0 <= y+j < w and s[x+i][y+j] == "#" and use[x+i][y+j] == 0:
use[x][y] = 1
use[x+i][y+j] = 1
else:
flg = False
cc = 0
for x in use: cc += x.count(1)
if flg and c == cc:
print("YES")
exit()
print("NO")
aqua_tenhou