Submission #44046547


Source Code Expand

N, M = map(int, input().split())
S = [input() for _ in range(N)]
ans = 0
for si in range(N - 9 + 1):
    for sj in range(M - 9 + 1):
        # if si == 0 and sj == 9:
        #     print("a")
        ok = True
        for di in range(9):
            for dj in range(9):
                i = si + di
                j = sj + dj
                if di < 3 and dj < 3:
                    if S[i][j] != "#":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("b")
                if di >= 6 and dj >= 6:
                    if S[i][j] != "#":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("c")
                if di == 3 and dj <= 3:
                    if S[i][j] != ".":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("d")
                if di <= 3 and dj == 3:
                    if S[i][j] != ".":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("e")
                if di == 5 and dj >= 5:
                    if S[i][j] != ".":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("f")
                if di >= 5 and dj == 5:
                    if S[i][j] != ".":
                        ok = False
                        # if si == 0 and sj == 9:
                        #     print("g")
        if ok:
            print(si + 1, sj + 1)
            ans += 1
# print(ans)

Submission Info

Submission Time
Task B - TaK Code
User terrafarm
Language Python (3.8.2)
Score 200
Code Size 1683 Byte
Status AC
Exec Time 317 ms
Memory 9168 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 17
Set Name Test Cases
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
Case Name Status Exec Time Memory
random_01.txt AC 317 ms 9048 KiB
random_02.txt AC 293 ms 8940 KiB
random_03.txt AC 59 ms 9100 KiB
random_04.txt AC 121 ms 8944 KiB
random_05.txt AC 290 ms 8944 KiB
random_06.txt AC 214 ms 9108 KiB
random_07.txt AC 276 ms 8944 KiB
random_08.txt AC 54 ms 9092 KiB
random_09.txt AC 312 ms 8948 KiB
random_10.txt AC 301 ms 9052 KiB
random_11.txt AC 286 ms 9168 KiB
random_12.txt AC 300 ms 9052 KiB
random_13.txt AC 291 ms 8948 KiB
random_14.txt AC 311 ms 8952 KiB
sample_01.txt AC 21 ms 8908 KiB
sample_02.txt AC 18 ms 9056 KiB
sample_03.txt AC 20 ms 8940 KiB