結果
| 問題 | No.179 塗り分け |
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-08-26 17:12:22 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 521 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 77,496 KB |
| 最終ジャッジ日時 | 2025-12-03 16:25:30 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 39 WA * 1 |
ソースコード
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"
Tawara