結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2020-04-21 22:12:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 957 bytes |
コンパイル時間 | 310 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 21,504 KB |
最終ジャッジ日時 | 2024-10-09 13:02:30 |
合計ジャッジ時間 | 11,186 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 3 WA * 1 TLE * 1 -- * 35 |
ソースコード
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")