Submission #1780504
Source Code Expand
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; char a[100][100],b[100][100]; 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]; } } bool flag=false; for(int vy=0;vy<n;vy++) { for(int vx=0;vx<n;vx++) { if(vy+m-1>=n || vx+m-1>=n) continue; bool match=false; for(int y=0;y<m;y++) { for(int x=0;x<m;x++) { if(a[vy+y][vx+x]==b[y][x]) match=true; } } if(match) flag=true; } } if(flag) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Template Matching |
User | kage |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 823 Byte |
Status | WA |
Exec Time | 2 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 | 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 | WA | 1 ms | 256 KB |
subtask_1_03.txt | AC | 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 | 2 ms | 256 KB |
subtask_1_08.txt | AC | 1 ms | 256 KB |