結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2015-08-26 17:12:22 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 66 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 13,636 KB |
最終ジャッジ日時 | 2024-10-02 14:44:06 |
合計ジャッジ時間 | 5,310 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 1 WA * 1 TLE * 1 -- * 37 |
ソースコード
from copy import deepcopy as dcp def check(di,dj): m = dcp(M) for i in xrange(H): for j in xrange(W): if m[i][j] == "#": ni = i + di nj = j + dj if 0 <= ni < H and 0 <= nj < W and m[ni][nj] == "#": m[ni][nj] = "." else: return False return True H,W = map(int,raw_input().split(" ")) M = [list(raw_input()) for i in xrange(H)] for j in xrange(1,W): if check(0,j): print "YES" quit() for i in xrange(1,H): for j in xrange(-W+1,W): if check(i,j): print "YES" quit() print "NO"