Submission #1211506
Source Code Expand
#include <stdio.h> #include <iostream> #include <algorithm> #include <functional> #include <cstdlib> #include <sstream> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <complex> #include <vector> #include <cstdio> #include <cmath> #include <time.h> #define all(c) ((c).begin(),(c).end()) #define rall(c) (c).rbegin(),(c).rend() #define sort(v,n) sort(v,v+n) #define vsort(v) sort(v.begin(),v.end()) #define vvsort(v) sort(v.begin(),v.end(),greater<int>()) #define ll long long #define pb(a) push_back(a) #define fi first #define se second #define inf 999999999 using namespace std; const ll MOD = 1e9 + 7; const double PI = acos(-1.0); //---------------------------------------------------------------------------------------------// int n, m; char a[60][60], b[60][60]; bool solve() { for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { if (a[i][j] != b[i][j]) { return 0; } } } return 1; } int main() { cin >> n >> m; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> a[i][j]; } } for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { cin >> b[i][j]; } } for (int i = 0; i < n - m + 1; i++) { for (int j = 0; j < n - m + 1; j++) { if (solve() == 1) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Template Matching |
User | aim_cpo |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1431 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 1 ms | 256 KB |
sample_02.txt | WA | 1 ms | 256 KB |
subtask_1_01.txt | WA | 1 ms | 256 KB |
subtask_1_02.txt | WA | 1 ms | 256 KB |
subtask_1_03.txt | WA | 1 ms | 256 KB |
subtask_1_04.txt | WA | 1 ms | 256 KB |
subtask_1_05.txt | WA | 1 ms | 256 KB |
subtask_1_06.txt | WA | 1 ms | 256 KB |
subtask_1_07.txt | WA | 1 ms | 256 KB |
subtask_1_08.txt | WA | 1 ms | 256 KB |