結果
問題 | No.179 塗り分け |
ユーザー |
|
提出日時 | 2016-09-05 10:16:47 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 555 bytes |
コンパイル時間 | 611 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2024-10-03 03:27:09 |
合計ジャッジ時間 | 2,813 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 6 |
other | AC * 2 WA * 38 |
ソースコード
H, W = map(int, raw_input().split()) s = [raw_input() for i in xrange(H)] dxdy = [(i, j) for i in xrange(H) for j in xrange(W)] dxdy.pop(0) xy = [(i, j) for i in xrange(H) for j in xrange(W)] for dx, dy in dxdy: taiou = set() print dx, dy for x, y in xy: if s[x][y] == '.': continue nx, ny = x+dx, y+dy if (x, y) in taiou: continue if nx >= H or ny >= W or s[nx][ny] == '.': break taiou.add((nx, ny)) else: print 'YES' break else: print 'NO'