Submission #1962272


Source Code Expand

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
char A[60][60];
char B[60][60];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++)scanf("%s",A[i]);
	for(int i=0;i<b;i++)scanf("%s",B[i]);
	for(int i=0;i<=a-b;i++)for(int j=0;j<=a-b;j++){
		bool ok=true;
		for(int k=0;k<b;k++)for(int l=0;l<b;l++){
			if(B[k][l]!=A[i+k][j+l])ok=false;
		}
		if(ok){
			printf("Yes\n");return 0;
		}
	}
	printf("No\n");
}

Submission Info

Submission Time
Task B - Template Matching
User tozangezan
Language C++14 (GCC 5.4.1)
Score 200
Code Size 648 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  int a,b;scanf("%d%d",&a,&b);
                             ^
./Main.cpp:18:38: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0;i<a;i++)scanf("%s",A[i]);
                                      ^
./Main.cpp:19:38: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0;i<b;i++)scanf("%s",B[i]);
                                      ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 10
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 128 KB
sample_02.txt AC 1 ms 128 KB
subtask_1_01.txt AC 1 ms 128 KB
subtask_1_02.txt AC 1 ms 128 KB
subtask_1_03.txt AC 1 ms 128 KB
subtask_1_04.txt AC 1 ms 128 KB
subtask_1_05.txt AC 1 ms 128 KB
subtask_1_06.txt AC 1 ms 128 KB
subtask_1_07.txt AC 1 ms 128 KB
subtask_1_08.txt AC 1 ms 128 KB