結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-03 17:20:05 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 835 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2026-09-28 20:38:30 |
| 合計ジャッジ時間 | 12,973 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 34 WA * 6 |
ソースコード
# -*- coding: utf-8 -*-
from copy import deepcopy
h,w = map(int, input().split())
s = [list(input()) for _ in range(h)]
def check(dh,dw):
s2 = deepcopy(s)
for hi in range(h):
for wi in range(w):
if h>hi+dh>=0 and w>wi+dw>=0:
if s2[hi][wi]=="#" and s2[hi+dh][wi+dw]=="#":
s2[hi][wi] = "r"
s2[hi+dh][wi+dw] = "b"
elif s2[hi][wi]=="#":
return False
elif s2[hi][wi]=="#":
return False
for hi in range(h):
for wi in range(w):
if s2[hi][wi]=="#":
return False
return True
for dh in range(h):
for dw in range(w):
if dh==0 and dw==0:
continue
if check(dh,dw):
print("YES")
exit()
print("NO")