結果

問題 No.179 塗り分け
ユーザー takakintakakin
提出日時 2020-04-21 22:12:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 957 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 21,504 KB
最終ジャッジ日時 2024-04-17 18:56:10
合計ジャッジ時間 10,135 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
21,504 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 24 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 361 ms
10,880 KB
testcase_06 AC 187 ms
10,880 KB
testcase_07 AC 1,525 ms
10,880 KB
testcase_08 AC 1,527 ms
10,752 KB
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
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 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
h,w=map(int,input().split())
S=[input() for _ in range(h)]
chk=False
for i in range(h):
  for j in range(w):
    for sign in range(2):
      if i==0 and j==0:
        continue
      else:
        cur=True
        ct=0
        C=[[False]*w for _ in range(h)]
        for ii in range(h):
          for jj in range(w):
            if S[ii][jj]==".":
              continue
            else:
              ct+=1
              if C[ii][jj]==False:
                if sign==0:
                  if 0<=ii+i<h and 0<=jj+j<w and S[ii+i][jj+j]=="#":
                    C[ii+i][jj+j]=True
                  else:
                    cur=False
                else:
                  if 0<=ii-i<h and 0<=jj+j<w and S[ii-i][jj+j]=="#":
                    C[ii-i][jj+j]=True
                  else:
                    cur=False
        if cur and ct:
          chk=True
if chk:
  print("YES")
else:
  print("NO")
0