結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
goto_isyuku
|
| 提出日時 | 2017-06-17 15:57:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 694 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,572 KB |
| 最終ジャッジ日時 | 2024-10-03 04:03:23 |
| 合計ジャッジ時間 | 4,742 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 TLE * 1 |
| other | -- * 40 |
ソースコード
h, w = [int(x) for x in input().split()]
tiles = []
for i in range(h):
l = input()
for j in range(w):
if l[j] == "#":
tiles.append((i, j))
vec = []
for i in range(h):
for j in range(-1 * w + 1 ,w):
vec.append((i, j))
del vec[vec.index((0, 0))]
tiles_num = len(tiles)
if tiles_num == 0:
print("NO")
else:
result = False
for v in vec:
ans = []
for t in tiles:
ot = (t[0] + v[0], t[1] + v[1])
if t not in ans and ot in tiles and ot not in ans:
ans.append(t)
ans.append(ot)
if tiles_num == len(ans):
result = True
break
if result:
print("YES")
else:
print("NO")
goto_isyuku