Submission #1780631
Source Code Expand
#include <iostream> #include <string> #include <cstdio> using namespace std; int main() { int N, M; cin >> N >> M; char A[50][50], B[50][50]; for (int ay = 0; ay < N; ay++) for (int ax = 0; ax < N; ax++) cin >> A[ay][ax]; for (int by = 0; by < M; by++) for (int bx = 0; bx < M; bx++) cin >> B[by][bx]; for (int i = 0; i <= N - M; i++) { for (int j = 0; j <= N - M; j++) { int match = 1; for (int ai = 0; ai < M; ai++) { for (int aj = 0; aj < M; aj++) { if (B[ai][aj] != A[i + ai][j + aj]) { match = 0; break; } } if (match == 0) break; } if (match) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Template Matching |
User | phyljh |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 779 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
subtask_1_01.txt | AC | 1 ms | 256 KB |
subtask_1_02.txt | AC | 1 ms | 256 KB |
subtask_1_03.txt | AC | 1 ms | 256 KB |
subtask_1_04.txt | AC | 1 ms | 256 KB |
subtask_1_05.txt | AC | 1 ms | 256 KB |
subtask_1_06.txt | AC | 1 ms | 256 KB |
subtask_1_07.txt | AC | 1 ms | 256 KB |
subtask_1_08.txt | AC | 1 ms | 256 KB |