結果

問題 No.179 塗り分け
ユーザー yaoshimaxyaoshimax
提出日時 2015-05-06 21:33:09
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 821 ms / 3,000 ms
コード長 745 bytes
コンパイル時間 1,612 ms
コンパイル使用メモリ 77,420 KB
実行使用メモリ 80,848 KB
最終ジャッジ日時 2023-09-30 20:41:25
合計ジャッジ時間 16,018 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,096 KB
testcase_01 AC 76 ms
76,420 KB
testcase_02 AC 83 ms
78,696 KB
testcase_03 AC 79 ms
76,616 KB
testcase_04 AC 91 ms
79,088 KB
testcase_05 AC 175 ms
80,012 KB
testcase_06 AC 132 ms
80,072 KB
testcase_07 AC 328 ms
80,080 KB
testcase_08 AC 339 ms
80,296 KB
testcase_09 AC 335 ms
80,076 KB
testcase_10 AC 415 ms
80,020 KB
testcase_11 AC 372 ms
79,644 KB
testcase_12 AC 702 ms
80,256 KB
testcase_13 AC 92 ms
78,920 KB
testcase_14 AC 89 ms
79,200 KB
testcase_15 AC 77 ms
76,440 KB
testcase_16 AC 75 ms
76,540 KB
testcase_17 AC 76 ms
76,712 KB
testcase_18 AC 381 ms
80,100 KB
testcase_19 AC 379 ms
80,264 KB
testcase_20 AC 623 ms
80,240 KB
testcase_21 AC 410 ms
80,732 KB
testcase_22 AC 476 ms
80,712 KB
testcase_23 AC 345 ms
80,048 KB
testcase_24 AC 388 ms
80,560 KB
testcase_25 AC 247 ms
80,084 KB
testcase_26 AC 320 ms
80,156 KB
testcase_27 AC 589 ms
80,520 KB
testcase_28 AC 421 ms
80,120 KB
testcase_29 AC 777 ms
80,308 KB
testcase_30 AC 567 ms
80,372 KB
testcase_31 AC 817 ms
80,848 KB
testcase_32 AC 526 ms
80,152 KB
testcase_33 AC 762 ms
80,592 KB
testcase_34 AC 551 ms
80,188 KB
testcase_35 AC 821 ms
80,576 KB
testcase_36 AC 76 ms
76,372 KB
testcase_37 AC 76 ms
76,516 KB
testcase_38 AC 76 ms
76,720 KB
testcase_39 AC 76 ms
76,428 KB
testcase_40 AC 86 ms
79,216 KB
testcase_41 AC 76 ms
76,164 KB
testcase_42 AC 84 ms
79,208 KB
testcase_43 AC 131 ms
79,776 KB
testcase_44 AC 193 ms
79,928 KB
testcase_45 AC 118 ms
80,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,raw_input().split())
board=[raw_input() for i in range(H)]

for dx in range(-H+1,H,+1):
    for dy in range(-W+1,W,+1):
        if dx==0 and dy==0:
            continue
        used=[[False for i in range(W)]for j in range(H)]
        ok=True
        cnt=0
        for h in range(H):
            for w in range(W):
                if board[h][w]=='#' and used[h][w]==False:
                    if h+dx<0 or h+dx>=H or w+dy<0 or w+dy>=W:
                        ok=False
                    elif board[h+dx][w+dy]=='.':
                        ok=False
                    else:
                        cnt+=1
                        used[h+dx][w+dy]=True
        if ok and cnt>0:
            print"YES"
            exit()
print "NO"
0