結果

問題 No.179 塗り分け
ユーザー FromBooskaFromBooska
提出日時 2023-10-15 19:35:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 831 bytes
コンパイル時間 571 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 78,128 KB
最終ジャッジ日時 2023-10-15 19:35:51
合計ジャッジ時間 8,154 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,336 KB
testcase_01 AC 69 ms
71,096 KB
testcase_02 AC 69 ms
71,248 KB
testcase_03 AC 68 ms
71,360 KB
testcase_04 AC 69 ms
71,444 KB
testcase_05 AC 128 ms
77,196 KB
testcase_06 AC 95 ms
76,872 KB
testcase_07 WA -
testcase_08 AC 180 ms
77,716 KB
testcase_09 WA -
testcase_10 AC 143 ms
77,532 KB
testcase_11 AC 132 ms
77,500 KB
testcase_12 AC 134 ms
77,504 KB
testcase_13 AC 74 ms
75,956 KB
testcase_14 AC 74 ms
76,512 KB
testcase_15 AC 69 ms
71,360 KB
testcase_16 AC 74 ms
71,616 KB
testcase_17 AC 68 ms
71,148 KB
testcase_18 AC 135 ms
77,488 KB
testcase_19 AC 134 ms
78,128 KB
testcase_20 AC 134 ms
77,324 KB
testcase_21 AC 147 ms
77,580 KB
testcase_22 AC 191 ms
77,624 KB
testcase_23 AC 137 ms
77,572 KB
testcase_24 AC 135 ms
77,340 KB
testcase_25 AC 140 ms
77,584 KB
testcase_26 WA -
testcase_27 AC 172 ms
77,516 KB
testcase_28 WA -
testcase_29 AC 150 ms
77,556 KB
testcase_30 WA -
testcase_31 AC 151 ms
77,488 KB
testcase_32 AC 172 ms
77,824 KB
testcase_33 AC 150 ms
77,428 KB
testcase_34 WA -
testcase_35 AC 156 ms
77,328 KB
testcase_36 AC 70 ms
71,248 KB
testcase_37 AC 68 ms
71,528 KB
testcase_38 AC 68 ms
71,252 KB
testcase_39 AC 68 ms
71,324 KB
testcase_40 AC 67 ms
71,352 KB
testcase_41 AC 68 ms
71,420 KB
testcase_42 AC 69 ms
71,604 KB
testcase_43 AC 85 ms
76,664 KB
testcase_44 AC 100 ms
77,204 KB
testcase_45 AC 80 ms
75,972 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)]
        for i in range(H-di):
            for j in range(W-dj):
                if S_num[i][j] == 1 and color[i][j] == 0:
                    color[i][j] = 1
                    color[i+di][j+dj] = 1
        if S_num == color:
            #print(di, dj, color)
            ans = 'YES'
print(ans)   
0