結果

問題 No.179 塗り分け
ユーザー nebukuro09nebukuro09
提出日時 2016-09-05 11:11:58
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,728 ms / 3,000 ms
コード長 612 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 6,872 KB
最終ジャッジ日時 2023-09-30 20:51:03
合計ジャッジ時間 6,726 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,936 KB
testcase_01 AC 11 ms
5,852 KB
testcase_02 AC 11 ms
6,056 KB
testcase_03 AC 11 ms
5,984 KB
testcase_04 AC 11 ms
5,936 KB
testcase_05 AC 21 ms
5,960 KB
testcase_06 AC 12 ms
5,956 KB
testcase_07 AC 1,728 ms
6,184 KB
testcase_08 AC 18 ms
6,392 KB
testcase_09 AC 50 ms
6,192 KB
testcase_10 AC 15 ms
6,520 KB
testcase_11 AC 14 ms
6,624 KB
testcase_12 AC 1,628 ms
6,872 KB
testcase_13 AC 11 ms
6,052 KB
testcase_14 AC 10 ms
5,948 KB
testcase_15 AC 11 ms
5,856 KB
testcase_16 AC 11 ms
5,880 KB
testcase_17 AC 11 ms
5,900 KB
testcase_18 AC 38 ms
6,460 KB
testcase_19 AC 15 ms
6,620 KB
testcase_20 AC 53 ms
6,532 KB
testcase_21 AC 206 ms
6,436 KB
testcase_22 AC 684 ms
6,532 KB
testcase_23 AC 14 ms
6,520 KB
testcase_24 AC 59 ms
6,588 KB
testcase_25 AC 14 ms
6,512 KB
testcase_26 AC 17 ms
6,508 KB
testcase_27 AC 23 ms
6,624 KB
testcase_28 AC 15 ms
6,632 KB
testcase_29 AC 24 ms
6,480 KB
testcase_30 AC 22 ms
6,488 KB
testcase_31 AC 33 ms
6,516 KB
testcase_32 AC 17 ms
6,636 KB
testcase_33 AC 29 ms
6,440 KB
testcase_34 AC 16 ms
6,432 KB
testcase_35 AC 31 ms
6,624 KB
testcase_36 AC 11 ms
5,860 KB
testcase_37 AC 10 ms
5,856 KB
testcase_38 AC 11 ms
5,900 KB
testcase_39 AC 11 ms
5,860 KB
testcase_40 AC 11 ms
5,952 KB
testcase_41 AC 11 ms
5,932 KB
testcase_42 AC 11 ms
6,040 KB
testcase_43 AC 12 ms
6,064 KB
testcase_44 AC 14 ms
6,032 KB
testcase_45 AC 12 ms
6,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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+1, W)]
xy = [(i, j) for i in xrange(H) for j in xrange(W)]

for dx, dy in dxdy:
    if dy <= 0 and dx == 0:
        continue
    taiou = set()
    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:
        if len(taiou) > 0:
            print 'YES'
            break
else:
    print 'NO'
0