結果

問題 No.179 塗り分け
ユーザー goto_isyukugoto_isyuku
提出日時 2017-06-17 16:03:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 730 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 16,164 KB
最終ジャッジ日時 2023-07-26 17:13:53
合計ジャッジ時間 4,879 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
16,164 KB
testcase_01 AC 19 ms
7,736 KB
testcase_02 AC 17 ms
7,796 KB
testcase_03 AC 17 ms
7,824 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
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 = []

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 = []
    ans_num = 0
    
    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)
        ans_num += 2
    
    if tiles_num == ans_num:

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