結果
問題 |
No.179 塗り分け
|
ユーザー |
|
提出日時 | 2015-04-05 23:49:00 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 752 bytes |
コンパイル時間 | 42 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-02 13:18:39 |
合計ジャッジ時間 | 19,467 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 34 WA * 6 |
ソースコード
H, W = map(int, raw_input().split()) S = [list(raw_input()) for i in xrange(H)] for dy in xrange(H): for dx in xrange(W): if dx + dy == 0: continue flag = True used = [[S[y][x] == "." for x in xrange(W)] for y in xrange(H)] for y in xrange(H): if not (0 <= y + dy < H): continue for x in xrange(W): if not (0 <= x + dx < W): continue if used[y][x]: continue if used[y+dy][x+dx]: flag = False break used[y][x] = used[y+dy][x+dx] = True if not flag: break else: if sum(map(sum, used)) != H*W: continue print "YES" exit() print "NO"