結果

問題 No.179 塗り分け
ユーザー toyuzukotoyuzuko
提出日時 2020-02-04 23:04:18
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 720 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 10,216 KB
最終ジャッジ日時 2023-10-21 06:39:46
合計ジャッジ時間 7,203 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,164 KB
testcase_01 AC 27 ms
10,164 KB
testcase_02 AC 29 ms
10,164 KB
testcase_03 AC 27 ms
10,164 KB
testcase_04 AC 25 ms
10,164 KB
testcase_05 AC 50 ms
10,176 KB
testcase_06 AC 27 ms
10,164 KB
testcase_07 WA -
testcase_08 AC 189 ms
10,212 KB
testcase_09 WA -
testcase_10 AC 31 ms
10,196 KB
testcase_11 AC 29 ms
10,192 KB
testcase_12 AC 274 ms
10,208 KB
testcase_13 AC 25 ms
10,168 KB
testcase_14 AC 28 ms
10,172 KB
testcase_15 AC 26 ms
10,164 KB
testcase_16 AC 27 ms
10,164 KB
testcase_17 AC 25 ms
10,164 KB
testcase_18 AC 30 ms
10,212 KB
testcase_19 AC 31 ms
10,216 KB
testcase_20 AC 217 ms
10,216 KB
testcase_21 AC 420 ms
10,212 KB
testcase_22 AC 1,024 ms
10,212 KB
testcase_23 AC 29 ms
10,196 KB
testcase_24 AC 240 ms
10,212 KB
testcase_25 AC 28 ms
10,216 KB
testcase_26 WA -
testcase_27 AC 204 ms
10,212 KB
testcase_28 WA -
testcase_29 AC 198 ms
10,212 KB
testcase_30 WA -
testcase_31 AC 207 ms
10,212 KB
testcase_32 AC 77 ms
10,216 KB
testcase_33 AC 203 ms
10,212 KB
testcase_34 WA -
testcase_35 AC 204 ms
10,212 KB
testcase_36 AC 27 ms
10,164 KB
testcase_37 AC 25 ms
10,164 KB
testcase_38 AC 24 ms
10,164 KB
testcase_39 AC 25 ms
10,164 KB
testcase_40 AC 26 ms
10,164 KB
testcase_41 AC 26 ms
10,164 KB
testcase_42 AC 28 ms
10,164 KB
testcase_43 AC 31 ms
10,176 KB
testcase_44 AC 49 ms
10,180 KB
testcase_45 AC 27 ms
10,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for dz in range(1,H*W):
    dx,dy = divmod(dz,W)
    checked = [[0 for j in range(W)] for i in range(H)]
    for sz in range(H*W):
        sx,sy = divmod(sz,W)
        if S[sx][sy] == '#' and not checked[sx][sy]:
            nx,ny = sx+dx,sy+dy
            if 0<=nx<H and 0<=ny<W and S[nx][ny] == '#':
                checked[nx][ny] = 1
            else:
                break
    else:
        print('YES')
        break
else:
    print('NO')
0