結果

問題 No.179 塗り分け
ユーザー roarisroaris
提出日時 2019-08-08 10:35:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 471 ms
コンパイル使用メモリ 86,724 KB
実行使用メモリ 78,372 KB
最終ジャッジ日時 2023-09-25 23:23:13
合計ジャッジ時間 8,117 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,192 KB
testcase_01 AC 73 ms
71,276 KB
testcase_02 AC 74 ms
71,132 KB
testcase_03 AC 73 ms
71,192 KB
testcase_04 AC 73 ms
71,148 KB
testcase_05 AC 108 ms
77,332 KB
testcase_06 AC 74 ms
71,276 KB
testcase_07 WA -
testcase_08 AC 181 ms
78,104 KB
testcase_09 AC 178 ms
77,440 KB
testcase_10 AC 78 ms
76,148 KB
testcase_11 AC 79 ms
75,996 KB
testcase_12 AC 193 ms
77,624 KB
testcase_13 AC 80 ms
75,128 KB
testcase_14 AC 80 ms
76,124 KB
testcase_15 AC 74 ms
71,412 KB
testcase_16 AC 71 ms
71,120 KB
testcase_17 AC 72 ms
71,412 KB
testcase_18 AC 95 ms
76,152 KB
testcase_19 AC 90 ms
76,404 KB
testcase_20 AC 187 ms
77,676 KB
testcase_21 AC 195 ms
77,668 KB
testcase_22 AC 220 ms
77,428 KB
testcase_23 AC 80 ms
75,760 KB
testcase_24 AC 189 ms
77,380 KB
testcase_25 AC 82 ms
76,456 KB
testcase_26 AC 105 ms
77,032 KB
testcase_27 AC 197 ms
77,824 KB
testcase_28 AC 96 ms
77,012 KB
testcase_29 AC 209 ms
77,676 KB
testcase_30 AC 143 ms
77,252 KB
testcase_31 AC 189 ms
77,592 KB
testcase_32 AC 125 ms
77,228 KB
testcase_33 AC 213 ms
78,372 KB
testcase_34 AC 117 ms
77,288 KB
testcase_35 AC 205 ms
78,364 KB
testcase_36 AC 74 ms
71,148 KB
testcase_37 AC 74 ms
71,080 KB
testcase_38 AC 73 ms
71,464 KB
testcase_39 AC 73 ms
71,240 KB
testcase_40 AC 76 ms
75,540 KB
testcase_41 AC 74 ms
71,476 KB
testcase_42 AC 73 ms
71,196 KB
testcase_43 AC 90 ms
76,868 KB
testcase_44 AC 105 ms
77,084 KB
testcase_45 AC 80 ms
76,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
S = [input() for _ in range(H)]

for dx in range(H):
    for dy in range(-W-1, W):
        if dx == 0 and dy <= 0:
            continue
        
        flag = [[-1 for _ in range(W)] for _ in range(H)]
        
        for i in range(H):
            for j in range(W):
                if S[i][j] == '#' and flag[i][j] == -1:
                    if i+dx < H and 0 <= j+dy < W and S[i+dx][j+dy] == '#':
                        flag[i][j] = 0
                        flag[i+dx][j+dy] = 1
                    else:
                        break
            else:
                continue
            break
        else:
            print('YES')
            exit()

print('NO')
0