結果

問題 No.179 塗り分け
ユーザー FromBooskaFromBooska
提出日時 2023-10-15 19:43:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 77,984 KB
最終ジャッジ日時 2023-10-15 19:43:30
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,364 KB
testcase_01 AC 74 ms
71,548 KB
testcase_02 AC 78 ms
71,396 KB
testcase_03 AC 75 ms
71,240 KB
testcase_04 AC 73 ms
71,344 KB
testcase_05 AC 103 ms
77,348 KB
testcase_06 AC 97 ms
76,888 KB
testcase_07 WA -
testcase_08 AC 186 ms
77,984 KB
testcase_09 WA -
testcase_10 AC 140 ms
77,716 KB
testcase_11 AC 143 ms
77,576 KB
testcase_12 AC 143 ms
77,488 KB
testcase_13 AC 80 ms
75,632 KB
testcase_14 AC 82 ms
76,344 KB
testcase_15 AC 74 ms
71,100 KB
testcase_16 AC 73 ms
71,296 KB
testcase_17 AC 72 ms
71,304 KB
testcase_18 AC 142 ms
77,884 KB
testcase_19 AC 144 ms
77,876 KB
testcase_20 AC 137 ms
77,492 KB
testcase_21 AC 153 ms
77,416 KB
testcase_22 AC 200 ms
77,624 KB
testcase_23 AC 147 ms
77,336 KB
testcase_24 AC 142 ms
77,328 KB
testcase_25 AC 144 ms
77,300 KB
testcase_26 WA -
testcase_27 AC 152 ms
77,560 KB
testcase_28 WA -
testcase_29 AC 156 ms
77,460 KB
testcase_30 WA -
testcase_31 AC 157 ms
77,584 KB
testcase_32 AC 190 ms
77,868 KB
testcase_33 AC 157 ms
77,784 KB
testcase_34 WA -
testcase_35 AC 160 ms
77,968 KB
testcase_36 AC 70 ms
71,544 KB
testcase_37 AC 69 ms
71,484 KB
testcase_38 AC 71 ms
71,564 KB
testcase_39 AC 74 ms
71,324 KB
testcase_40 AC 69 ms
71,452 KB
testcase_41 AC 69 ms
71,304 KB
testcase_42 AC 71 ms
71,368 KB
testcase_43 AC 89 ms
76,832 KB
testcase_44 AC 102 ms
77,572 KB
testcase_45 AC 80 ms
75,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 黒を平行移動2グループに分けられるか
# 平行移動(di, dj)で全探索

H, W = map(int, input().split())
S = []
S_num = []
for i in range(H):
    temp = input()
    S.append(temp)
    s = []
    for t in temp:
        if t == '.':
            s.append(0)
        else:
            s.append(1)
    S_num.append(s)

ans = 'NO'
for di in range(0, H):
    for dj in range(0, W):
        if (di, dj) == (0, 0):
            continue
        
        #print('di', di, 'dj', dj)
        color = [[0]*W for i in range(H)]
        bad = False
        for i in range(H-di):
            for j in range(W-dj):
                #print('i', i, 'j', j)
                if S_num[i][j] == 1 and color[i][j] == 0:
                    color[i][j] = 1
                    if color[i+di][j+dj] == 1:
                        bad = True
                    color[i+di][j+dj] = 1
        if S_num == color and bad == False:
            #print(di, dj, color)
            ans = 'YES'
print(ans)   
0