Submission #62463665


Source Code Expand

"""
<方針>
- ラスター走査する.
"""
# 入力
N, M = map(int, input().split())
SS = [list(input()) for _ in range(N)]
TT = [list(input()) for _ in range(M)]

# ラスター走査
for i in range(N-M+1):
  for j in range(N-M+1):
    # チェック
    ng = False
    for y in range(M):
      for x in range(M):
        if(SS[i+y][j+x] != TT[y][x]):
          ng = True
    
    # 全て同一であれば,
    if(not ng):
      a = i+1
      b = j+1
      print(a, b)

Submission Info

Submission Time
Task B - Seek Grid
User mattsunkun
Language Python (PyPy 3.10-v7.3.12)
Score 200
Code Size 500 Byte
Status AC
Exec Time 73 ms
Memory 82072 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 26
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 55 ms 76396 KiB
00_sample_02.txt AC 55 ms 76536 KiB
01_random_01.txt AC 62 ms 81632 KiB
01_random_02.txt AC 65 ms 81848 KiB
01_random_03.txt AC 64 ms 81880 KiB
01_random_04.txt AC 65 ms 81288 KiB
01_random_05.txt AC 63 ms 81464 KiB
01_random_06.txt AC 72 ms 81896 KiB
01_random_07.txt AC 65 ms 82072 KiB
01_random_08.txt AC 73 ms 81824 KiB
01_random_09.txt AC 60 ms 81864 KiB
01_random_10.txt AC 69 ms 81692 KiB
01_random_11.txt AC 65 ms 81736 KiB
01_random_12.txt AC 68 ms 81784 KiB
01_random_13.txt AC 67 ms 81872 KiB
01_random_14.txt AC 73 ms 81736 KiB
01_random_15.txt AC 71 ms 81720 KiB
01_random_16.txt AC 68 ms 81684 KiB
01_random_17.txt AC 65 ms 81648 KiB
01_random_18.txt AC 71 ms 81820 KiB
01_random_19.txt AC 72 ms 81880 KiB
01_random_20.txt AC 67 ms 82044 KiB
02_handmade_01.txt AC 55 ms 76532 KiB
02_handmade_02.txt AC 55 ms 76568 KiB
02_handmade_03.txt AC 55 ms 76792 KiB
02_handmade_04.txt AC 58 ms 81028 KiB