結果

問題 No.179 塗り分け
ユーザー MitI_7MitI_7
提出日時 2015-12-27 12:42:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 896 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-14 05:56:38
合計ジャッジ時間 5,589 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,752 KB
testcase_01 AC 39 ms
10,752 KB
testcase_02 AC 34 ms
10,880 KB
testcase_03 AC 41 ms
10,752 KB
testcase_04 AC 34 ms
10,752 KB
testcase_05 AC 81 ms
10,752 KB
testcase_06 AC 35 ms
10,752 KB
testcase_07 WA -
testcase_08 AC 157 ms
10,880 KB
testcase_09 WA -
testcase_10 AC 34 ms
10,880 KB
testcase_11 AC 34 ms
10,752 KB
testcase_12 AC 166 ms
10,752 KB
testcase_13 AC 39 ms
10,752 KB
testcase_14 AC 55 ms
10,752 KB
testcase_15 AC 36 ms
10,752 KB
testcase_16 AC 34 ms
10,752 KB
testcase_17 WA -
testcase_18 AC 36 ms
10,752 KB
testcase_19 AC 37 ms
10,752 KB
testcase_20 AC 157 ms
10,752 KB
testcase_21 AC 187 ms
11,008 KB
testcase_22 AC 261 ms
10,880 KB
testcase_23 AC 32 ms
10,752 KB
testcase_24 AC 163 ms
10,752 KB
testcase_25 AC 33 ms
10,752 KB
testcase_26 WA -
testcase_27 AC 157 ms
10,752 KB
testcase_28 WA -
testcase_29 AC 158 ms
10,880 KB
testcase_30 WA -
testcase_31 AC 155 ms
10,752 KB
testcase_32 AC 65 ms
10,752 KB
testcase_33 AC 160 ms
10,880 KB
testcase_34 WA -
testcase_35 AC 160 ms
10,880 KB
testcase_36 AC 37 ms
10,752 KB
testcase_37 AC 35 ms
10,752 KB
testcase_38 AC 35 ms
10,752 KB
testcase_39 AC 34 ms
10,752 KB
testcase_40 AC 35 ms
10,752 KB
testcase_41 AC 35 ms
10,752 KB
testcase_42 AC 34 ms
10,752 KB
testcase_43 AC 58 ms
10,752 KB
testcase_44 AC 78 ms
10,752 KB
testcase_45 AC 42 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def func(d, r, field):
    for y in range(len(field)):
        for x in range(len(field[y])):
            if field[y][x] == '#':
                ny = y + d
                nx = x + r
                if ny < len(field) and nx < len(field[y]) and field[ny][nx] == '#':
                    field[y][x] = 0
                    field[ny][nx] = 1
                else:
                    return False

    for line in field:
        if '#' in line:
            return False

    return True


def main():
    h, w = map(int, input().split())
    field = []
    for _ in range(h):
        field.append(list(input()))

    for i in range(51):
        for j in range(51):
            if i == 0 and j == 0:
                continue

            if func(i, j, [[i for i in j] for j in field]):
                print("YES")
                return
    print("NO")
    
if __name__ == '__main__':
    main()
0