結果

問題 No.179 塗り分け
ユーザー goto_isyukugoto_isyuku
提出日時 2017-06-17 15:07:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 22,784 KB
最終ジャッジ日時 2024-04-14 06:47:32
合計ジャッジ時間 6,363 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 33 ms
11,136 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 OLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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