結果

問題 No.179 塗り分け
ユーザー goto_isyukugoto_isyuku
提出日時 2017-06-17 16:20:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 757 bytes
コンパイル時間 457 ms
コンパイル使用メモリ 82,672 KB
実行使用メモリ 83,764 KB
最終ジャッジ日時 2024-04-14 06:49:31
合計ジャッジ時間 7,107 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
59,836 KB
testcase_01 AC 38 ms
52,460 KB
testcase_02 AC 40 ms
57,608 KB
testcase_03 AC 40 ms
57,284 KB
testcase_04 AC 41 ms
58,756 KB
testcase_05 AC 723 ms
76,020 KB
testcase_06 AC 65 ms
67,796 KB
testcase_07 AC 41 ms
59,280 KB
testcase_08 AC 49 ms
66,716 KB
testcase_09 AC 49 ms
66,584 KB
testcase_10 AC 545 ms
76,180 KB
testcase_11 AC 457 ms
76,200 KB
testcase_12 TLE -
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 = set()
    ans_num = 0
    
    for t in tiles:
      
      ot = (t[0] + v[0], t[1] + v[1])
      
      if t not in ans:
        if ot in tiles:
          if ot not in ans:
            ans.add(t)
            ans.add(ot)
            ans_num += 2
    
    if tiles_num == ans_num:

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