結果

問題 No.179 塗り分け
ユーザー naesiranaesira
提出日時 2023-11-23 17:34:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 79,704 KB
最終ジャッジ日時 2023-11-23 17:34:35
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 80 ms
76,020 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 42 ms
59,720 KB
testcase_11 AC 41 ms
59,720 KB
testcase_12 AC 181 ms
77,568 KB
testcase_13 AC 41 ms
59,596 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 WA -
testcase_17 AC 36 ms
53,460 KB
testcase_18 AC 58 ms
72,928 KB
testcase_19 AC 57 ms
72,432 KB
testcase_20 AC 179 ms
78,320 KB
testcase_21 AC 216 ms
78,552 KB
testcase_22 AC 204 ms
78,816 KB
testcase_23 AC 42 ms
59,592 KB
testcase_24 AC 193 ms
78,936 KB
testcase_25 AC 50 ms
66,244 KB
testcase_26 WA -
testcase_27 AC 208 ms
78,936 KB
testcase_28 WA -
testcase_29 AC 213 ms
78,176 KB
testcase_30 WA -
testcase_31 AC 212 ms
78,560 KB
testcase_32 AC 125 ms
76,520 KB
testcase_33 AC 217 ms
78,944 KB
testcase_34 WA -
testcase_35 AC 221 ms
78,564 KB
testcase_36 AC 40 ms
53,460 KB
testcase_37 AC 36 ms
53,460 KB
testcase_38 AC 36 ms
53,460 KB
testcase_39 AC 35 ms
53,460 KB
testcase_40 AC 36 ms
53,460 KB
testcase_41 AC 36 ms
53,460 KB
testcase_42 AC 36 ms
53,460 KB
testcase_43 AC 58 ms
72,732 KB
testcase_44 AC 79 ms
75,760 KB
testcase_45 AC 48 ms
64,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

H, W = map(int, input().split())
S = [input() for i in range(H)]

if S == ['.'*W]*H:
  print("NO")
  exit()

for p, q in product(range(H-1), range(W-1)):
  if p == q == 0: continue
  T = [list(S[i]) for i in range(H)]
  for i, j in product(range(H-p), range(W-q)):
    if T[i][j] == T[p+i][q+j] == '#':
      T[i][j] = T[p+i][q+j] = '!'
  
  if all('#' not in row for row in T):
    print("YES")
    break
else:
  print("NO")
0