結果

問題 No.179 塗り分け
ユーザー goto_isyukugoto_isyuku
提出日時 2017-06-17 14:46:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-04-14 06:47:13
合計ジャッジ時間 3,058 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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:
      
      if t not in ans:
        if (t[0] + v[0], t[1] + v[1])  in tiles and (t[0] + v[0], t[1] + v[1]) not in ans:
          ans.add(t)
          ans.add((t[0] + v[0], t[1] + v[1]))
        else:
          break
    
    if tiles == ans:

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