Submission #62270024
Source Code Expand
Copy
import sysN, M = map(int, input().split())S = [list(input()) for _ in range(N)]T = [list(input()) for _ in range(M)]for i in range(N - M + 1):for j in range(N - M + 1):num = 0for k in range(M):for l in range(M):if T[k][l] == S[i + k][j + l]:num += 1if num == M ** 2:print(i + 1, j + 1)sys.exit()
import sys N, M = map(int, input().split()) S = [list(input()) for _ in range(N)] T = [list(input()) for _ in range(M)] for i in range(N - M + 1): for j in range(N - M + 1): num = 0 for k in range(M): for l in range(M): if T[k][l] == S[i + k][j + l]: num += 1 if num == M ** 2: print(i + 1, j + 1) sys.exit()
Submission Info
Submission Time | |
---|---|
Task | B - Seek Grid |
User | sushitempura |
Language | Python (PyPy 3.10-v7.3.12) |
Score | 200 |
Code Size | 379 Byte |
Status | AC |
Exec Time | 67 ms |
Memory | 81884 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 | 54 ms | 76464 KB |
00_sample_02.txt | AC | 54 ms | 76420 KB |
01_random_01.txt | AC | 58 ms | 81116 KB |
01_random_02.txt | AC | 60 ms | 81676 KB |
01_random_03.txt | AC | 63 ms | 81640 KB |
01_random_04.txt | AC | 63 ms | 81224 KB |
01_random_05.txt | AC | 60 ms | 81016 KB |
01_random_06.txt | AC | 63 ms | 81620 KB |
01_random_07.txt | AC | 61 ms | 81428 KB |
01_random_08.txt | AC | 64 ms | 81648 KB |
01_random_09.txt | AC | 60 ms | 81660 KB |
01_random_10.txt | AC | 67 ms | 81604 KB |
01_random_11.txt | AC | 61 ms | 81500 KB |
01_random_12.txt | AC | 64 ms | 81424 KB |
01_random_13.txt | AC | 63 ms | 81720 KB |
01_random_14.txt | AC | 63 ms | 81580 KB |
01_random_15.txt | AC | 64 ms | 81388 KB |
01_random_16.txt | AC | 61 ms | 81764 KB |
01_random_17.txt | AC | 61 ms | 81388 KB |
01_random_18.txt | AC | 64 ms | 81844 KB |
01_random_19.txt | AC | 63 ms | 81884 KB |
01_random_20.txt | AC | 66 ms | 81728 KB |
02_handmade_01.txt | AC | 53 ms | 76472 KB |
02_handmade_02.txt | AC | 53 ms | 76272 KB |
02_handmade_03.txt | AC | 54 ms | 76580 KB |
02_handmade_04.txt | AC | 56 ms | 80968 KB |