結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 83 ms
76,016 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 42 ms
59,716 KB
testcase_11 AC 41 ms
59,716 KB
testcase_12 AC 181 ms
77,564 KB
testcase_13 AC 41 ms
59,596 KB
testcase_14 AC 38 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,796 KB
testcase_19 AC 59 ms
72,428 KB
testcase_20 AC 179 ms
78,188 KB
testcase_21 AC 194 ms
78,676 KB
testcase_22 AC 205 ms
78,556 KB
testcase_23 AC 42 ms
59,588 KB
testcase_24 AC 194 ms
78,932 KB
testcase_25 AC 50 ms
66,240 KB
testcase_26 WA -
testcase_27 AC 210 ms
78,932 KB
testcase_28 WA -
testcase_29 AC 212 ms
78,172 KB
testcase_30 WA -
testcase_31 AC 211 ms
78,300 KB
testcase_32 AC 125 ms
76,516 KB
testcase_33 AC 215 ms
78,812 KB
testcase_34 WA -
testcase_35 AC 220 ms
78,688 KB
testcase_36 AC 37 ms
53,460 KB
testcase_37 AC 37 ms
53,460 KB
testcase_38 AC 37 ms
53,460 KB
testcase_39 AC 37 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,728 KB
testcase_44 AC 82 ms
75,756 KB
testcase_45 AC 48 ms
63,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

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