提出 #44051588


ソースコード 拡げる

H, W = list(map(int, input().split(' ')))
grid = []
for _ in range(H):
    S = list(input())
    grid.append(S)

black = []
white = [
    (3, 0), (3, 1), (3, 2), (3, 3), (2, 3), (1, 3), (0, 3),
    (5, 5), (5, 6), (5, 7), (5, 8), (6, 5), (7, 5), (8, 5)
]

blacks = [[0, 1, 2], [6, 7, 8]]
for b in blacks:
    for x in b:
        for y in b:
            black.append((y, x))


def check(y, x):
    for dy in range(9):
        for dx in range(9):
            nx = x + dx
            ny = y + dy
            if 0 <= nx < W and 0 <= ny < H:
                if (dy, dx) in black:
                    if grid[ny][nx] != "#":
                        return False
                if (dy, dx) in white:
                    if grid[ny][nx] != ".":
                        return False
            else:
                return False
    return True


for y in range(H):
    for x in range(W):
        if check(y, x):
            print(y + 1, x + 1)

提出情報

提出日時
問題 B - TaK Code
ユーザ cocodrips
言語 PyPy3 (7.3.0)
得点 200
コード長 978 Byte
結果 AC
実行時間 108 ms
メモリ 74928 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 17
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
random_01.txt AC 108 ms 74928 KiB
random_02.txt AC 82 ms 74664 KiB
random_03.txt AC 72 ms 73772 KiB
random_04.txt AC 75 ms 74392 KiB
random_05.txt AC 78 ms 74780 KiB
random_06.txt AC 80 ms 74360 KiB
random_07.txt AC 79 ms 74660 KiB
random_08.txt AC 71 ms 74096 KiB
random_09.txt AC 81 ms 74188 KiB
random_10.txt AC 82 ms 74308 KiB
random_11.txt AC 71 ms 73880 KiB
random_12.txt AC 73 ms 74012 KiB
random_13.txt AC 64 ms 74040 KiB
random_14.txt AC 89 ms 74012 KiB
sample_01.txt AC 52 ms 65532 KiB
sample_02.txt AC 52 ms 65008 KiB
sample_03.txt AC 50 ms 64360 KiB