結果

問題 No.179 塗り分け
ユーザー gorugo30gorugo30
提出日時 2021-03-16 23:14:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 76,984 KB
最終ジャッジ日時 2024-04-26 06:14:31
合計ジャッジ時間 5,866 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 41 ms
52,224 KB
testcase_02 AC 39 ms
52,096 KB
testcase_03 AC 40 ms
52,352 KB
testcase_04 AC 40 ms
52,480 KB
testcase_05 AC 95 ms
76,524 KB
testcase_06 AC 41 ms
52,224 KB
testcase_07 AC 41 ms
52,864 KB
testcase_08 AC 160 ms
76,672 KB
testcase_09 WA -
testcase_10 AC 48 ms
59,520 KB
testcase_11 AC 49 ms
59,520 KB
testcase_12 AC 152 ms
76,544 KB
testcase_13 AC 49 ms
59,776 KB
testcase_14 AC 50 ms
60,928 KB
testcase_15 AC 40 ms
51,968 KB
testcase_16 AC 41 ms
51,712 KB
testcase_17 AC 40 ms
52,096 KB
testcase_18 AC 72 ms
70,144 KB
testcase_19 AC 72 ms
71,192 KB
testcase_20 AC 161 ms
76,516 KB
testcase_21 AC 166 ms
76,544 KB
testcase_22 AC 208 ms
76,600 KB
testcase_23 AC 48 ms
59,776 KB
testcase_24 AC 189 ms
76,724 KB
testcase_25 AC 60 ms
65,792 KB
testcase_26 WA -
testcase_27 AC 181 ms
76,584 KB
testcase_28 WA -
testcase_29 AC 191 ms
76,552 KB
testcase_30 WA -
testcase_31 AC 185 ms
76,544 KB
testcase_32 AC 126 ms
76,416 KB
testcase_33 AC 191 ms
76,544 KB
testcase_34 WA -
testcase_35 AC 190 ms
76,544 KB
testcase_36 AC 41 ms
52,224 KB
testcase_37 AC 40 ms
51,968 KB
testcase_38 AC 40 ms
51,968 KB
testcase_39 AC 41 ms
52,352 KB
testcase_40 AC 40 ms
52,352 KB
testcase_41 AC 39 ms
52,224 KB
testcase_42 AC 42 ms
52,480 KB
testcase_43 AC 76 ms
71,424 KB
testcase_44 AC 94 ms
76,412 KB
testcase_45 AC 57 ms
63,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cnt = sum([grid[i].count("#") for i in range(H)])
if cnt < 2:
    print("NO")
    exit()
for tatehoukounoshift in range(H):
    for yokohoukounoshift in range(W):
        if tatehoukounoshift == yokohoukounoshift == 0:
            continue
        can = True
        used = [[False] * W for i in range(H)]
        for i in range(H):
            for j in range(W):
                if used[i][j] or grid[i][j] == ".":
                    continue
                if not (0 <= i + tatehoukounoshift < H and 0 <= j + yokohoukounoshift < W):
                    can = False
                    break
                if grid[i + tatehoukounoshift][j + yokohoukounoshift] == ".":
                    can = False
                used[i][j] = True
                used[i + tatehoukounoshift][j + yokohoukounoshift] = True
        if can:
            print("YES")
            exit()
print("NO")
0