結果

問題 No.2641 draw X
ユーザー miho-4miho-4
提出日時 2024-02-19 22:53:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 185,080 KB
最終ジャッジ日時 2024-02-19 22:53:28
合計ジャッジ時間 4,988 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
60,264 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 34 ms
53,460 KB
testcase_05 AC 39 ms
53,460 KB
testcase_06 AC 35 ms
53,456 KB
testcase_07 AC 35 ms
53,460 KB
testcase_08 WA -
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 35 ms
53,460 KB
testcase_11 AC 39 ms
53,460 KB
testcase_12 AC 35 ms
53,460 KB
testcase_13 AC 35 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 162 ms
122,660 KB
testcase_16 TLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())
L=[list(input()) for _ in range(H)]

dhw=[(1,1),(1,-1),(-1,1),(-1,-1)]
P=[]
for h in range(H):
  for w in range(W):
    if L[h][w]=="#":
      flag=1
      for dh,dw in dhw:
        if not(0<=h+dh<H and 0<=w+dw<W and L[h+dh][w+dw]=="#"):
          flag=0
      if flag:
        P.append((h,w))

dp=[["."]*W for _ in range(H)]
for h,w in P:
  dp[h][w]="#"
  x=1
  flag=1
  while flag:
    for dh,dw in dhw:
      if not(0<=h+dh*x<H and 0<=w+dw*x<W):
        flag=0
    if flag:
      for dh,dw in dhw:
        dp[h+dh*x][w+dw*x]="#"
    x+=1
print("Yes" if L==dp else "No")
0