結果

問題 No.179 塗り分け
ユーザー gr1msl3ygr1msl3y
提出日時 2022-05-16 23:08:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 85,212 KB
最終ジャッジ日時 2023-10-12 17:50:24
合計ジャッジ時間 13,308 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,240 KB
testcase_01 AC 75 ms
71,368 KB
testcase_02 AC 73 ms
71,464 KB
testcase_03 AC 74 ms
71,212 KB
testcase_04 AC 76 ms
71,252 KB
testcase_05 AC 142 ms
77,028 KB
testcase_06 AC 80 ms
75,584 KB
testcase_07 WA -
testcase_08 AC 85 ms
76,292 KB
testcase_09 AC 85 ms
76,500 KB
testcase_10 AC 105 ms
77,096 KB
testcase_11 AC 102 ms
77,036 KB
testcase_12 AC 1,615 ms
85,212 KB
testcase_13 AC 74 ms
71,244 KB
testcase_14 AC 74 ms
71,132 KB
testcase_15 AC 73 ms
71,348 KB
testcase_16 AC 73 ms
71,356 KB
testcase_17 WA -
testcase_18 AC 105 ms
76,972 KB
testcase_19 AC 104 ms
76,728 KB
testcase_20 AC 674 ms
79,776 KB
testcase_21 AC 182 ms
77,308 KB
testcase_22 AC 196 ms
77,088 KB
testcase_23 AC 86 ms
76,260 KB
testcase_24 AC 160 ms
77,128 KB
testcase_25 AC 83 ms
76,200 KB
testcase_26 AC 114 ms
76,724 KB
testcase_27 AC 437 ms
78,384 KB
testcase_28 AC 110 ms
76,804 KB
testcase_29 AC 656 ms
79,840 KB
testcase_30 AC 355 ms
79,140 KB
testcase_31 AC 800 ms
82,628 KB
testcase_32 AC 293 ms
78,332 KB
testcase_33 AC 817 ms
81,436 KB
testcase_34 AC 245 ms
78,300 KB
testcase_35 AC 936 ms
83,096 KB
testcase_36 AC 74 ms
71,368 KB
testcase_37 AC 73 ms
71,356 KB
testcase_38 AC 75 ms
70,984 KB
testcase_39 AC 73 ms
71,184 KB
testcase_40 AC 73 ms
71,160 KB
testcase_41 AC 72 ms
71,364 KB
testcase_42 AC 74 ms
74,944 KB
testcase_43 AC 89 ms
76,064 KB
testcase_44 AC 148 ms
76,940 KB
testcase_45 AC 79 ms
75,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
S = [input() for _ in range(H)]
T = []
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            T.append((i, j))


def solve(h, w):
    seen = {t: 0 for t in T}
    for t in T:
        if seen[t]:
            continue
        seen[t] = 1
        nt = t[0]+h, t[1]+w
        if nt not in T:
            break
        if seen[nt]:
            break
        seen[nt] = 1
    else:
        return 1
    return 0


for i in range(H):
    for j in range(-W+1, W):
        if solve(i, j):
            print('YES')
            exit()
else:
    print('NO')
0