結果
問題 | No.179 塗り分け |
ユーザー |
|
提出日時 | 2023-04-15 19:15:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 693 bytes |
コンパイル時間 | 93 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 21,632 KB |
最終ジャッジ日時 | 2024-10-11 04:28:45 |
合計ジャッジ時間 | 5,194 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 6 TLE * 1 -- * 33 |
ソースコード
def res(): H,W=map(int,input().split()) S=[[None] for _ in range(H)] for i in range(H): S[i]=list(input()) b=[] for i in range(H): for j in range(W): if S[i][j]=='#': b.append([i,j]) if (len(b)>1)and(len(b)%2==0): o=b[0] for i in b: l1=i[0]-o[0] l2=i[1]-o[1] t=[i for i in b] while t: j=t.pop(0) if [j[0]+l1,j[1]+l2]in t: t.remove([j[0]+l1,j[1]+l2]) else: break if len(t)==0: return 'YES' return 'NO' return 'NO' print(res())