結果

問題 No.179 塗り分け
コンテスト
ユーザー goto_isyuku
提出日時 2017-06-17 15:07:03
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 702 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 53 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2026-09-09 09:40:30
合計ジャッジ時間 34,421 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 6
other AC * 3 WA * 34 OLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h, w = [int(x) for x in input().split()]

tiles = set()

for i in range(h):
  l = input()
  for j in range(w):
    if l[j] == "#":
      tiles.add((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))]

if len(tiles) == 0:
  print("NO")
else:
  
  result = False
  
  for v in vec:
    ans = set()
    
    for t in tiles:
      
      ot = (t[0] + v[0], t[1] + v[1])
      
      if t not in ans:
        if ot in tiles and ot not in ans:
          ans.add(t)
          ans.add(ot)
    
    print(v)    
    print(ans)
    
    if tiles == ans:

      result = True
      break
  
  if result:
    print("YES")
  else:
    print("NO")
0