結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 38 ms
53,460 KB
testcase_04 AC 38 ms
53,460 KB
testcase_05 AC 87 ms
76,020 KB
testcase_06 AC 38 ms
53,460 KB
testcase_07 AC 39 ms
53,460 KB
testcase_08 AC 219 ms
79,072 KB
testcase_09 WA -
testcase_10 AC 43 ms
59,720 KB
testcase_11 AC 42 ms
59,720 KB
testcase_12 AC 188 ms
77,696 KB
testcase_13 AC 45 ms
61,852 KB
testcase_14 AC 43 ms
59,840 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 AC 37 ms
53,460 KB
testcase_17 AC 36 ms
53,460 KB
testcase_18 AC 59 ms
73,056 KB
testcase_19 AC 58 ms
72,416 KB
testcase_20 AC 216 ms
79,076 KB
testcase_21 AC 200 ms
78,808 KB
testcase_22 AC 207 ms
78,688 KB
testcase_23 AC 42 ms
59,592 KB
testcase_24 AC 195 ms
78,552 KB
testcase_25 AC 50 ms
66,244 KB
testcase_26 WA -
testcase_27 AC 241 ms
78,552 KB
testcase_28 WA -
testcase_29 AC 216 ms
78,304 KB
testcase_30 WA -
testcase_31 AC 223 ms
78,176 KB
testcase_32 AC 124 ms
76,520 KB
testcase_33 AC 221 ms
78,176 KB
testcase_34 WA -
testcase_35 AC 216 ms
78,180 KB
testcase_36 AC 38 ms
53,460 KB
testcase_37 AC 38 ms
53,460 KB
testcase_38 AC 36 ms
53,460 KB
testcase_39 AC 37 ms
53,460 KB
testcase_40 AC 38 ms
53,460 KB
testcase_41 AC 37 ms
53,460 KB
testcase_42 AC 40 ms
53,460 KB
testcase_43 AC 59 ms
72,728 KB
testcase_44 AC 80 ms
75,760 KB
testcase_45 AC 49 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), range(W)):
  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