criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N,M;
cin >> N >> M;
const int nmmax=50;
char A[nmmax][nmmax],B[nmmax][nmmax];
for(int y=0;y<N;++y){
for(int x=0;x<N;++x){
cin >> A[y][x];
 }
 }

for(int y=0;y<M;++y){
 for(int x=0;x<M;++x){
 cin >> B[y][x];
 }
 }
 bool exist=false;

 for(int ly=0;ly<N;++ly){
 for(int lx=0;lx<N;++lx){
 if(ly+M-1>=N or lx+M-1>=N) continue;

 bool match=true;
 for(int y=0;y<M;++y){
 for(int x=0;x<M;++x){
 if(A[ly+y][lx+x]!=B[y][x]) match=false;
 }
 }
 if(match) exist=true;
 }
 }

 if(exist)
 cout << "Yes" << endl;
 else
 cout << "No" << endl;

 return 0;
 }
}

Compiler output:
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy

vector<vl> v;

ll modpow(ll a, ll x){
    if(x == 1) return a;
    if(x == 0) return 1;
    if(x%2 == 0){
        ll t = (modpow(a,x/2)%MOD);
        return (t*t)%MOD;
    }
    ll t = (modpow(a,x/2)%MOD);
    return (t*t*a)%MOD;
}

ll check(ll x,ll y, ll size){
    ll ans = 0;
    rep(i,x,x+size) rep(j,y,y+size){
        ans = (ans + v[i][j]*modpow(2,((i-x)*100 + (j-y))))%MOD;
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    ll n,m;
    cin >> n >> m;

    rp(i,n) {
        vl temp;
        v.pb(temp);
        rp(j,n){
            char c;
            cin >> c;
            if(c == '#') v[i].pb(0LL);
            else v[i].pb(1LL);
        }
    }
    ll curH = 0;
    rp(i,m) {
        rp(j,m){
            char c;
            cin >> c;
            ll x;
            if(c == '#') x = 0;
            else x = 1;
            curH = (curH + x*modpow(2,((i)*100 + j)))%MOD;
        }
    }
    rp(i,n-m+1) rp(j,n-m+1){
         if(curH == check(i,j,m))
         {
             cout << "Yes"<<endl;
             return 0;
         }
    }
    cout << "No"<<endl;a

    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343


Compiler output:
a.cc: In function 'int main()':
a.cc:102:24: error: 'a' was not declared in this scope
  102 |     cout << "No"<<endl;a
      |                        ^
Language: C++

/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

int main(void){
    int n, m;
    cin >> n >> m;

    vector<string> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i]
    }
    vector<string> b(m);
    for(int i = 0; i < m; i++){
        cin >> b[i];
    }

    for(int i = 0; i < n - m + 1; i++){
        for(int j = 0; j < n - m + 1; j++){
            bool ok = true;
            for(int k = 0; k < m; k++){
                for(int l = 0; l < m; l++){
                    if(a[i + k][j + l] == b[k][l]){
                        continue;
                    } else {
                        ok = false;
                        break;
                    }
                }
                if(!ok) break;
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:20: error: expected ';' before '}' token
   68 |         cin >> a[i]
      |                    ^
      |                    ;
   69 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a,b;
  bool e=true;
  cin>>a>>b;
  vector<string> c(a),d(b);
  rep(i,a)cin>>c.at(i);
  rep(i,b)cin>>d.at(i);
  rep(i,a-b+1)rep(j,a-b+1){
    rep(k,b)rep(l,b){
      if(d.at(k).at(l)!=c.at(k+i).(l+j)
        e=false;k=l=b;
 }
    if(e){
      cout<<"Yes";
      return 0;
    }
    }
  cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: expected unqualified-id before '(' token
   17 |       if(d.at(k).at(l)!=c.at(k+i).(l+j)
      |                                   ^
a.cc:18:22: error: expected ')' before ';' token
   18 |         e=false;k=l=b;
      |                      ^
      |                      )
a.cc:17:9: note: to match this '('
   17 |       if(d.at(k).at(l)!=c.at(k+i).(l+j)
      |         ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a,b;
  bool e=true;
  cin>>a>>b;
  vector<string> c(a),d(b);
  rep(i,a)cin>>c.at(i);
  rep(i,b)cin>>d.at(i);
  rep(i,a-b+1)rep(j,a-b+1){
    rep(k,b)rep(l,b){
      if(d.at(k).at(l)!=c.at(k+i).(l+j))
        e=false;k=l=m;
 }
    if(e){
      cout<<"Yes";
      return 0;
    }
    }
  cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: expected unqualified-id before '(' token
   17 |       if(d.at(k).at(l)!=c.at(k+i).(l+j))
      |                                   ^
a.cc:18:21: error: 'm' was not declared in this scope
   18 |         e=false;k=l=m;
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
string b[60],p[60];
bool match(int x,int y){
  rep(i,m){
    rep(j,m){
      if(b[x+i][y+j]!=p[i][j])return false;
    }
  }
  return true;
}
int main(){
  cin>>n>>m;
  rep(i,n)cin>>b[i];
  rep(i,m)cin>>p[i];
  bool f=false;
  for(i=0;i<=n-m;i++){
    for(int j=0;j<=n-m;j++){
  if(match(i,j))f=true;
    }
  }
  cout<<(f?"Yes":"No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'i' was not declared in this scope
   27 |   for(i=0;i<=n-m;i++){
      |       ^
Language: C++

#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
bool use_mask;
Mat img; Mat templ; Mat mask; Mat result;
const char* image_window = "Source Image";
const char* result_window = "Result window";
int match_method;
int max_Trackbar = 5;
void MatchingMethod( int, void* );
int main( int argc, char** argv )
{
  if (argc < 3)
  {
    cout << "Not enough parameters" << endl;
    cout << "Usage:\n./MatchTemplate_Demo <image_name> <template_name> [<mask_name>]" << endl;
    return -1;
  }
  img = imread( argv[1], IMREAD_COLOR );
  templ = imread( argv[2], IMREAD_COLOR );
  if(argc > 3) {
    use_mask = true;
    mask = imread( argv[3], IMREAD_COLOR );
  }
  if(img.empty() || templ.empty() || (use_mask && mask.empty()))
  {
    cout << "Can't read one of the images" << endl;
    return -1;
  }
  namedWindow( image_window, WINDOW_AUTOSIZE );
  namedWindow( result_window, WINDOW_AUTOSIZE );
  const char* trackbar_label = "Method: \n 0: SQDIFF \n 1: SQDIFF NORMED \n 2: TM CCORR \n 3: TM CCORR NORMED \n 4: TM COEFF \n 5: TM COEFF NORMED";
  createTrackbar( trackbar_label, image_window, &match_method, max_Trackbar, MatchingMethod );
  MatchingMethod( 0, 0 );
  waitKey(0);
  return 0;
}
void MatchingMethod( int, void* )
{
  Mat img_display;
  img.copyTo( img_display );
  int result_cols =  img.cols - templ.cols + 1;
  int result_rows = img.rows - templ.rows + 1;
  result.create( result_rows, result_cols, CV_32FC1 );
  bool method_accepts_mask = (TM_SQDIFF == match_method || match_method == TM_CCORR_NORMED);
  if (use_mask && method_accepts_mask)
    { matchTemplate( img, templ, result, match_method, mask); }
  else
    { matchTemplate( img, templ, result, match_method); }
  normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() );
  double minVal; double maxVal; Point minLoc; Point maxLoc;
  Point matchLoc;
  minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() );
  if( match_method  == TM_SQDIFF || match_method == TM_SQDIFF_NORMED )
    { matchLoc = minLoc; }
  else
    { matchLoc = maxLoc; }
  rectangle( img_display, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );
  rectangle( result, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );
  imshow( image_window, img_display );
  imshow( result_window, result );
  return;

Compiler output:
a.cc:1:10: fatal error: opencv2/imgcodecs.hpp: No such file or directory
    1 | #include "opencv2/imgcodecs.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

/// Global Variables
Mat img; Mat templ; Mat result;
char* image_window = "Source Image";
char* result_window = "Result window";

int match_method;
int max_Trackbar = 5;

/// Function Headers
void MatchingMethod( int, void* );

/** @function main */
int main( int argc, char** argv )
{
  /// Load image and template
  img = imread( argv[1], 1 );
  templ = imread( argv[2], 1 );

  /// Create windows
  namedWindow( image_window, CV_WINDOW_AUTOSIZE );
  namedWindow( result_window, CV_WINDOW_AUTOSIZE );

  /// Create Trackbar
  char* trackbar_label = "Method: \n 0: SQDIFF \n 1: SQDIFF NORMED \n 2: TM CCORR \n 3: TM CCORR NORMED \n 4: TM COEFF \n 5: TM COEFF NORMED";
  createTrackbar( trackbar_label, image_window, &match_method, max_Trackbar, MatchingMethod );

  MatchingMethod( 0, 0 );

  waitKey(0);
  return 0;
}

/**
 * @function MatchingMethod
 * @brief Trackbar callback
 */
void MatchingMethod( int, void* )
{
  /// Source image to display
  Mat img_display;
  img.copyTo( img_display );

  /// Create the result matrix
  int result_cols =  img.cols - templ.cols + 1;
  int result_rows = img.rows - templ.rows + 1;

  result.create( result_rows, result_cols, CV_32FC1 );

  /// Do the Matching and Normalize
  matchTemplate( img, templ, result, match_method );
  normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() );

  /// Localizing the best match with minMaxLoc
  double minVal; double maxVal; Point minLoc; Point maxLoc;
  Point matchLoc;

  minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() );

  /// For SQDIFF and SQDIFF_NORMED, the best matches are lower values. For all the other methods, the higher the better
  if( match_method  == CV_TM_SQDIFF || match_method == CV_TM_SQDIFF_NORMED )
    { matchLoc = minLoc; }
  else
    { matchLoc = maxLoc; }

  /// Show me what you got
  rectangle( img_display, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );
  rectangle( result, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );

  imshow( image_window, img_display );
  imshow( result_window, result );

  return;
}

Compiler output:
a.cc:1:10: fatal error: opencv2/highgui/highgui.hpp: No such file or directory
    1 | #include "opencv2/highgui/highgui.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

include<bits/stdc++.h>
using namespace std;
int main(){
	int n , m ;
	cin>>n>>m;
	char x[n][n];
	char k[m][m];
	for( int i=0;i<n;i++)
        scanf("%s",&x[i]);
    for( int i=0;i<m;i++)
	scanf("%s",&k[i]);
        
    for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			int counter=0;
			for(int c=0; c<m;c++){
		     	for(int d=0; d<m;c++){
				if(k[c][d]==x[i+c][j+d])
				counter++;
				}
					
			}	
			if(counter==(m*m)){
				printf("Yes\n");
			}
		}	
}
printf("No\n");
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>n>>m;
      |         ^~~
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%s",&x[i]);
      |         ^~~~~
a.cc:11:9: error: 'scanf' was not declared in this scope
   11 |         scanf("%s",&k[i]);
      |         ^~~~~
a.cc:24:33: error: 'printf' was not declared in this scope
   24 |                                 printf("Yes\n");
      |                                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<bits/stdc++.h>
a.cc:28:1: error: 'printf' was not declared in this scope
   28 | printf("No\n");
      | ^~~~~~
a.cc:28:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{ 
int n,m;
bool z=false;
cout<<"please enter the length of image A \n";
cin>>n;
cout<<"please enter the length of image B \n";
cin>>m;
char A[n][n],B[m][m];
for(int i=0;i<n;i++)
{
	for(int j=0;j<n;j++)
		gets(A[i][j]);
}
for(int i=0;i<m;i++)
{
	for(int j=0;j<m;j++)
		gets(B[i][j]);
}
for(int i=0;i<m;i++)
{
	for(int j=0;j<m;j++)
	{
		for(int x=0;x<n;x++)
		{
			for(int y=0;y<n;Y++)
			{
				if(B[i][j]==A[x][y])
				{
					z=true;
					break;
				}
			}
		
			if(z==true)
				break;
		}
		if(z==true)
			break;	
	}

	if(z==true)
		break;
}
if(z==true)
	cout<<"Yes";
else
	cout<<"No";
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |                 gets(A[i][j]);
      |                 ^~~~
      |                 getw
a.cc:21:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   21 |                 gets(B[i][j]);
      |                 ^~~~
      |                 getw
a.cc:29:41: error: 'Y' was not declared in this scope
   29 |                         for(int y=0;y<n;Y++)
      |                                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char x[55][55];
char y[55][55];

int main()
{
	int a,b,p,cnt=0;
    cin>>a>>b;
    for(int i=0; i<a; i++){
    	 for(int j=0; j<a; j++){
    	 	cin>>x[i][j];
		 }    
	}
    for(int i=0; i<b; i++){
    	 for(int j=0; j<b; j++){
    		cin>>y[i][j];    	
		}      
	}
    
	if(a!=1)
    for(int i=0; i<a-b; i++)
    {
    for(int j=0; j<a-b; j++)
    {
    for(int k=0; k<b; k++)
    {
    for(int l=0; l<b; l++)
    {
        if(x[i+k][l+j]==y[i+k][l+j])
            cnt++;
    }
    }
    }
    }
    p=b*b;
   	if(cnt==p){
   		return cout<<"Yes" ,0 ;
	}
    else if(a==1 && b==1 ){         
   		return cout<<"Yes" ,0;
	}
	else if(b>a ){         
   		return cout<<"No" ,0;
	else
	{
		return   cout<<"No" ,0;
	}   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: expected '}' before 'else'
   45 |         else
      |         ^~~~
a.cc:43:22: note: to match this '{'
   43 |         else if(b>a ){
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
char arr[n][n];
char arr1[m][m];
    for(int i=0; i<n; i++)
        scanf("%s",arr[i]);
    for(int i=0; i<m; i++)
        scanf("%s",arr1[i]);
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            int c=0;
            for(int a=0; a<m; a++)
            {
                for(int b=0; b<m; b++)
                {
                    if(arr1[a][b]==arr[i+a][j+b])
                        c++;
                }
            }
            if(c==(m*m))
            {
                printf("Yes\n");
                return 0;
            }
        }
    }
    printf("No\n");33
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:22: error: expected ';' before '}' token
   33 |     printf("No\n");33
      |                      ^
      |                      ;
   34 | }
      | ~
Language: C++



#include <bits/stdc++.h>
using namespace std;
int main()
{
 int n,m;
cin>>m>>n;
char arr[n][n];
char arr1[m][m];
for (int i=0;i<n;i++)
scanf("%s",arr[i]);
for (int i=0;i<n;i++)
scanf("%s",arr1[i]);

for (int i=0;i<n;i++)
{

for (int j=0;j<n;j++)
{
int count=0;
for (int a=0;a<m;a++)
{

for (int b=0;b<m;b++)
{
if(arr1[a][b]==arr [i+a][j+b];
count ++;
}}
if(count==(m*m)){
printf("yes");
return 0;
}}}

printf("no")
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: expected ')' before ';' token
   28 | count ++;
      |         ^
      |         )
a.cc:27:3: note: to match this '('
   27 | if(arr1[a][b]==arr [i+a][j+b];
      |   ^
a.cc:35:13: error: expected ';' before '}' token
   35 | printf("no")
      |             ^
      |             ;
   36 | }
      | ~
Language: C

#include <bits/stdc++.h>
using namespace std; 
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
char arr[n][n];
char arr1[m][m];
    for(int i=0; i<n; i++)
        scanf("%s",arr[i]);
    for(int i=0; i<m; i++)
        scanf("%s",arr1[i]);
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            int c=0;
            for(int a=0; a<m; a++)
            {
                for(int b=0; b<m; b++)
                {
                    if(arr1[a][b]==arr[i+a][j+b])
                        c++;
                }
            }
            if(c==(m*m))
            {
                printf("Yes\n");
                return 0;
            }
        }
    }
    printf("No\n");
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
char ar[n][n];
char ar[m][m];
    for(int i=0; i<n; i++)
        scanf("%s",ar[i]);
 
    for(int i=0; i<m; i++)
        scanf("%s",ar1[i]);
 
 
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            int cnt=0;
            for(int a=0; a<m; a++)
            {
                for(int b=0; b<m; b++)
                {
                    if(ar1[a][b]==ar[i+a][j+b])
                        cnt++;
                }
 
            }
            if(cnt==(m*m))
            {
                printf("Yes\n");
                return 0;
            }
 
        }
    }
    printf("No\n");
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: conflicting declaration 'char ar [m][m]'
   10 | char ar[m][m];
      |      ^~
a.cc:9:6: note: previous declaration as 'char ar [n][n]'
    9 | char ar[n][n];
      |      ^~
a.cc:15:20: error: 'ar1' was not declared in this scope; did you mean 'ar'?
   15 |         scanf("%s",ar1[i]);
      |                    ^~~
      |                    ar
a.cc:27:24: error: 'ar1' was not declared in this scope; did you mean 'ar'?
   27 |                     if(ar1[a][b]==ar[i+a][j+b])
      |                        ^~~
      |                        ar
Language: C++

# Python program to illustrate  
# template matching 
import cv2 
import numpy as np 
  
# Read the main image 
img_rgb = cv2.imread('mainimage.jpg'). 
  
# Convert it to grayscale 
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) 
  
# Read the template 
template = cv2.imread('template',0) 
  
# Store width and heigth of template in w and h 
w, h = template.shape[::-1] 
  
# Perform match operations. 
res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED) 
  
# Specify a threshold 
threshold = 0.8
  
# Store the coordinates of matched area in a numpy array 
loc = np.where( res >= threshold)  
  
# Draw a rectangle around the matched region. 
for pt in zip(*loc[::-1]): 
    cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0,255,255), 2) 
  
# Show the final image with the matched area. 
cv2.imshow('Detected',img_rgb) ;

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #Python
    1 | # Python program to illustrate
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #template
    2 | # template matching
      |   ^~~~~~~~
a.cc:6:3: error: invalid preprocessing directive #Read
    6 | # Read the main image
      |   ^~~~
a.cc:7:22: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
    7 | img_rgb = cv2.imread('mainimage.jpg').
      |                      ^~~~~~~~~~~~~~~
a.cc:9:3: error: invalid preprocessing directive #Convert
    9 | # Convert it to grayscale
      |   ^~~~~~~
a.cc:12:3: error: invalid preprocessing directive #Read
   12 | # Read the template
      |   ^~~~
a.cc:13:23: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   13 | template = cv2.imread('template',0)
      |                       ^~~~~~~~~~
a.cc:15:3: error: invalid preprocessing directive #Store
   15 | # Store width and heigth of template in w and h
      |   ^~~~~
a.cc:18:3: error: invalid preprocessing directive #Perform; did you mean #error?
   18 | # Perform match operations.
      |   ^~~~~~~
      |   error
a.cc:21:3: error: invalid preprocessing directive #Specify
   21 | # Specify a threshold
      |   ^~~~~~~
a.cc:24:3: error: invalid preprocessing directive #Store
   24 | # Store the coordinates of matched area in a numpy array
      |   ^~~~~
a.cc:27:3: error: invalid preprocessing directive #Draw
   27 | # Draw a rectangle around the matched region.
      |   ^~~~
a.cc:31:3: error: invalid preprocessing directive #Show
   31 | # Show the final image with the matched area.
      |   ^~~~
a.cc:32:12: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   32 | cv2.imshow('Detected',img_rgb) ;
      |            ^~~~~~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import cv2
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++


// loop through the search image
for ( size_t x = 0; x <= S_cols - T_cols; x++ ) {
    for ( size_t y = 0; y <= S_rows - T_rows; y++ ) {
        SAD = 0.0;

        // loop through the template image
        for ( size_t j = 0; j < T_cols; j++ )
            for ( size_t i = 0; i < T_rows; i++ ) {

                pixel p_SearchIMG = S[y+i][x+j];
                pixel p_TemplateIMG = T[i][j];
		
                SAD += abs( p_SearchIMG.Grey - p_TemplateIMG.Grey );
            }

        // save the best found position 
        if ( minSAD > SAD ) { 
            minSAD = SAD;
            // give me min SAD
            position.bestRow = y;
            position.bestCol = x;
            position.bestSAD = SAD;
        }
    }
    
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for ( size_t x = 0; x <= S_cols - T_cols; x++ ) {
      | ^~~
a.cc:3:21: error: 'x' does not name a type
    3 | for ( size_t x = 0; x <= S_cols - T_cols; x++ ) {
      |                     ^
a.cc:3:43: error: 'x' does not name a type
    3 | for ( size_t x = 0; x <= S_cols - T_cols; x++ ) {
      |                                           ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
int n,m,w1=0,w2=0,b1=0,b2=0;
cin>>n>>m;
char a[n][n];
char b[m][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;i++){
	for(int j=0;j<n;j++){
		if(a[i][j]=="."){
			w1++;
		}
		else
		b1++;
	}
}
for(int i=0;i<m;i++){
	for(int j=0;j<m;j++){
		if(b[i][j]=="."){
			w2++;
		}
		else
		b2++;
	}
}
if((w2<=w1)&&(b2<=b1)){
	cout<<"yes";
}
else
cout<<"no";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |                 if(a[i][j]=="."){
      |                    ~~~~~~~^~~~~
a.cc:30:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                 if(b[i][j]=="."){
      |                    ~~~~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int a,b,c;
  c=0;
  cin>>a>>b;
  vector<vector<char>> c(a,vector<char>(a));
  vector<vector<char>> d(b,vector<char>(b));
  for(int i=0;i<a;i++){
    for(int j=0;j<a;j++)
      cin>>c.at(i).at(j);
  }
  for(int i=0;i<b;i++){
    for(int j=0;j<b;j++)
      cin>>d.at(i).at(j);
  }
  for(int i=0;i<a-b+1;i++){
    for(int j=0;j<a-b+1;j++){
      if(d.at(0).at(0)==c.at(i).at(j)){
        for(int k=0;k<b;k++){
          for(int l=0;l<b;l++){
            if(d.at(k).at(l)!=c.at(i+k).at(j+l)){
              c=1;
              break;
            }
            if(k==b-1&&l==b-1){
              c=2;
              break;
            }
          }
            if(c==1){
              c=0;
              break;
            }
            if(c==2)
              break;
        }
      }
      if(c==2)
              break;
    }
    if(c==2)
              break;
  }
  if(c==2)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: conflicting declaration 'std::vector<std::vector<char> > c'
    8 |   vector<vector<char>> c(a,vector<char>(a));
      |                        ^
a.cc:5:11: note: previous declaration as 'int c'
    5 |   int a,b,c;
      |           ^
a.cc:12:14: error: request for member 'at' in 'c', which is of non-class type 'int'
   12 |       cin>>c.at(i).at(j);
      |              ^~
a.cc:20:27: error: request for member 'at' in 'c', which is of non-class type 'int'
   20 |       if(d.at(0).at(0)==c.at(i).at(j)){
      |                           ^~
a.cc:23:33: error: request for member 'at' in 'c', which is of non-class type 'int'
   23 |             if(d.at(k).at(l)!=c.at(i+k).at(j+l)){
      |                                 ^~
Language: C++

#include<bits/stdc++.h>
#include<cstring>
using namespace std;
string s, s1, s2;
int a, b,W=0;
char ch[55][55];
char ch1[55][55];
int main()
{
	cin>>a,b;
	for(int i=0;i<=a;i++){
		for(int j=0;j<a;j++)
			cin>>ch[i][j];
	for(int i=0;i<b;i++){
			for(int j=0;j<b;j++){
				cin>>ch1[i][j];
				if(ch[i][j]==ch1[i][j]){
					W++;
				}
				else{
					W--;
				}
			}
		
		}
	}
	if(W<=b)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: expected '}' at end of input
   34 |         }
      |          ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#include<cstring>
using namespace std;


{
	int a, b;
	onst int n=le7 =9;
	char ch[55][55];
	char ch1[55][55];
	int main()
	cin>>a,b;
	for(int i=0;i<a;i++)
		for(int j=0;j<a;j++)
			cin>>ch[i][j];
	for(int i=0;i<a;i++)
		for(int j=0;j<a;j++)
			cin>>ch[i][j];
	if(ch[i][j]==ch1[i][j]){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return ;
}

Compiler output:
a.cc:6:1: error: expected unqualified-id before '{' token
    6 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#include<cstring>
using namespace std;
string s, s1, s2;
int a, b;
const int n=le7 =9;
char ch[55][55];
char ch1[55][55];
int main()
{
	cin>>a,b;
	for(int i=0;i<a;i++)
		for(int j=0;j<a;j++)
			cin>>ch[i][j];
	for(int i=0;i<a;i++)
		for(int j=0;j<a;j++)
			cin>>ch[i][j];
	if(ch[i][j]==ch1[i][j]){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return ;
}

Compiler output:
a.cc:6:13: error: 'le7' was not declared in this scope
    6 | const int n=le7 =9;
      |             ^~~
a.cc: In function 'int main()':
a.cc:18:15: error: 'i' was not declared in this scope
   18 |         if(ch[i][j]==ch1[i][j]){
      |               ^
a.cc:18:18: error: 'j' was not declared in this scope
   18 |         if(ch[i][j]==ch1[i][j]){
      |                  ^
a.cc:24:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |         return ;
      |         ^~~~~~
Language: C

#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007
//S.size()
//配列名.Length()
using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;

int main(void){
	int N ,M; cin>>N>>M;
	string a[N],b[M];
	rep(i ,N)cin>>a[i];
	rep(j ,M)cin>>b[j];
	bool jud = false;
	int cnt = 0;

	for(int t = 0; t < N - M + 1; t++){
		for(int k = 0; k < N - M + 1; k++){
			cnt = 0;
			for(int s = 0; s < M; s++){
				for(int q = 0; q < M; q++){
					if(a[t + s][k + q] == b[s][q])cnt++;
				}
			}
			if(cnt == M * M){
				jud = true;
			}
		}
	}

	cout<<(jud?"Yes":"No");

}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,yes=0;cin>>n>>m;
  vector<string> a(n),b(m);
  for(int i=0;i<n;i++)cin>>a.at(i);
  for(int j=0;j<m;j++)cin>>b.at(j);
  for(int k=0;k<n-m+1){
    for(int l=0;l<n-m+1){
      int x=0;
      for(int p=l;p<l+m-1;p++){
        if(a.at(k+p).substr(l,m)!=b.at(p)){
          x++;
          break;
        }
      }
      if(x==0){
        cout<<"Yes"<<endl;
        yes=1;
        break;
      }
    }
    if(yes==1)break;
  }
  if(yes==0)cout<<"No"<<endl;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before ')' token
    8 |   for(int k=0;k<n-m+1){
      |                      ^
      |                      ;
a.cc:9:24: error: expected ';' before ')' token
    9 |     for(int l=0;l<n-m+1){
      |                        ^
      |                        ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  
  bool flag=false;
  
  vector<vector<char>>A<N,vector<char>(N)>;
  
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++{
      cin>>A.at(i).at(j);
    }
        }
        
        vector<vector<char>>B(M,vector<char>(M));
        
        for(int i=0;i<M;i++){
          for(int j=0;j<M;j++){
cin>>B.at(i).at(j);
          }
        }
        
        for(int i=0;i<=N-M;i++){
          for(int j=0;j<=N-M;j++){
            int sum=0;
            for(int k=0;k<M;k++){
              for(int l=0;l<M;l++{
A.at(0+k+i).at(M-1+l+j)==B.at(k).at(l);
                sum++;
              }
                  }
                  
                  if(sum==M*M){
cout<<"Yes"<<endl;
                    flag=true;
                    break;
                  }
                  }
                  
                  if(flag){
                    break;
                  }
                  }
                  if(flag==false){
cout<<"Mo"<<endl;
                  
                  }

                  
                  
  
            


Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected initializer before '<' token
    9 |   vector<vector<char>>A<N,vector<char>(N)>;
      |                        ^
a.cc:12:24: error: expected ')' before '{' token
   12 |     for(int j=0;j<M;j++{
      |        ~               ^
      |                        )
a.cc:13:12: error: 'A' was not declared in this scope
   13 |       cin>>A.at(i).at(j);
      |            ^
a.cc:29:34: error: expected ')' before '{' token
   29 |               for(int l=0;l<M;l++{
      |                  ~               ^
      |                                  )
a.cc:30:1: error: 'A' was not declared in this scope
   30 | A.at(0+k+i).at(M-1+l+j)==B.at(k).at(l);
      | ^
a.cc:49:20: error: expected '}' at end of input
   49 |                   }
      |                    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N,M;
  cin >> N >> M;
  
  vector<vector<char>>A(N,vector<char>(N));
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      cin >> A[i][j];
    }
  }
  
  vector<vector<char>>B(M,vector<char>(M));
  for(int i=0;i<M;i++){
    for(int j=0;j<M;j++){
      cin >> B[i][j];
    }
  }
  
  bool match;
  
  for(int i=0;i<N-M;i++){
    for(int j=0;j<N-m;j++){
      match = true;
      for(int k=0;k<M;k++){
        for(int l=0;l<M;l++){
          if(B[k][l] != A[i + k][j + l])
            match = false;
        }
      }
      if(match)
        break;
    }
    if(match)
      break;
  }
  
  if(match)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
  return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'm' was not declared in this scope
   25 |     for(int j=0;j<N-m;j++){
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long

int main(){
    int i, j, n, m, k, l;
    cin>>n>>m;
    char a[n][n], b[m][m];
    for(i=0; i<n; i++){
        cin>>a[i];
    }
    for(i=0; i<m; i++){
        cin>>b[i];
    }
    int flag = 0:
    for(i=0; i<n-m+1; i++){
        for(j=0; j<n-m+1; j++){
            flag = 1;
            for(k=0; k<m; k++){
                for(l=0; k<m; l++){
                    if(a[i+k][i+l]!=b[k][l]){
                        flag = 0;
                    }
                }
            }
            if(flag == 1){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: expected ',' or ';' before ':' token
   21 |     int flag = 0:
      |                 ^
a.cc:22:26: error: expected ';' before ')' token
   22 |     for(i=0; i<n-m+1; i++){
      |                          ^
      |                          ;
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;
ll mod = pow(10,9) + 7;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}
int main() {
	int N,M; cin>>N>>M;
    const int nmmax=50;
    char A[nmmax][nmmax],B[nmmax][nmmax];
    for(int y=0;y<N;++y){
        for(int x=0;x<N;++x){
            cin >> A[y][x];
        }
}
    for(int y=0;y<M;++y){
        for(int x=0;x<M;++x){
            cin >> B[y][x];
        }
}
    bool exist=false;
    for(int ly=0;ly<N;++ly){
        for(int lx=0;lx<N;++lx){
            if(ly+M-1>=N or lx+M-1>=N) continue;
            bool match=true;
            for(int y=0;y<M;++y){
                for(int x=0;x<M;++x){
                    if(A[ly+y][lx+x]!=B[y][x]) match=false;
} }
            if(match) exist=true;
        }
}
    if(exist)
        cout << "Yes" << endl;
else
        cout << "No" << endl;
    return 0;
}
}

Compiler output:
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int n,m;
vector<string> a;
vector<string> b;

bool check(int h, int w){
  for(int i=0;i<m&&h<n;i++){
    if(m[i]==a[h].substr(w,m)) h++;
    else return false;
  }
  return true;
}

int main(){
  cin>>n>>m;
  a.resize(n);
  b.resize(m);
  for(int i=0;i<n;i++) cin>>a[i];
  for(int i=0;i<m;i++) cin>>b[i];

  bool flag=false;
  for(int i=0;i<n;i++){
    for(int j=0;(j+m)<n;j++){
      if(b[0]==a[i].substr(j,m)) flag=check(i,j);
      if(flag){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;  
}


Compiler output:
a.cc: In function 'bool check(int, int)':
a.cc:12:9: error: invalid types 'int[int]' for array subscript
   12 |     if(m[i]==a[h].substr(w,m)) h++;
      |         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
	cin >> n >> m;
	vector<string> a(n), b(m);
	for (auto&& ai : a) cin >> ai;
	for (auto&& bi : b) cin >> bi;
	bool found = false;
	for (int r = 0; r < n-m; r++)
	{
		for (int c = 0; c < n-m; c++)
		{
			found = true;
			for (int i = 0; i < m; i++)
				if (a[i+r].substr(c, m) != b[i])
				{
					found = false;
					break;
				}
			if (found) break;
		}
		if (found) break;
	}
	cout << (found ? "Yes" : "No") << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin >> n >> m;
      |                ^
      |                yn
a.cc:7:21: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |         cin >> n >> m;
      |                     ^
      |                     tm
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rfor(i, a, b) for(int i = a; i < (int)b; i++)
#define all(ary) (ary).begin(), (ary).end()
#define debug(x) cerr << #x << ": " << x << '\n'
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
using namespace std;
using v = vector<int>;
using ll = long long;
template <class T = int> T in(){ T x; cin >> x; return (x);}

int main(int argc, char *argv[]){
    int n, m; cin >> n >> m;
    vector<string> A(n), B(m);
    string res;
    bool flag = true;

    rep(i, n) cin >> A[i];
    rep(i, m) cin >> B[i];
    if(n == 1 and m == 1){
        if(A[0][0] == B[0][0]) goto yes;
        else goto res;
    }
    rep(i, n){
        if(i + m > n - 1) break;
        rep(j, n){
            if(j + m > n - 1) break;
            flag = true;
            rep(x, m){
                if(!flag) break;
                rep(y, m){
                    if(A[i+x][j+y] != B[x][y]){
                        flag = false;
                        break;
                    }
                }
            }
            if(flag){
                yes:
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
res:
    cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:40:17: error: jump to label 'yes'
   40 |                 yes:
      |                 ^~~
a.cc:22:37: note:   from here
   22 |         if(A[0][0] == B[0][0]) goto yes;
      |                                     ^~~
a.cc:27:13: note:   crosses initialization of 'int j'
   27 |         rep(j, n){
      |             ^
a.cc:2:27: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(int i = 0; i < (int)n; i++)
      |                           ^
a.cc:25:9: note:   crosses initialization of 'int i'
   25 |     rep(i, n){
      |         ^
a.cc:2:27: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(int i = 0; i < (int)n; i++)
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  
  char A[N][N], B[M][M];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; i++) {
      cin >> A[i][j];
    }
  }
  
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; i++) {
      cin >> B[i][j];
    }
  }
  for (int i = 0; i + M <= N; i++) {
    for (int j = 0; j + M <= N; j++) {
      bool ans = ture;
      for (int x = 0; x < M; x++) {
        for (int y = 0; y < M; y++) {
          if(A[i + x][i + y] != B[x][y]) {
            ans = false;
          }
        } 
      }
      if (ans) {
        cout << Yes;
        return 0;
      }
    }
  }
  cout << No;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'ture' was not declared in this scope
   22 |       bool ans = ture;
      |                  ^~~~
a.cc:31:17: error: 'Yes' was not declared in this scope
   31 |         cout << Yes;
      |                 ^~~
a.cc:36:11: error: 'No' was not declared in this scope; did you mean 'N'?
   36 |   cout << No;
      |           ^~
      |           N
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  char a[50], b[50];
  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 e = 0;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      if(i + m - 1 >= m || j + m - 1 >= n) {
        continue;
      }
      bool match = 1;
      for(int y = 0; y < m; y++) {
        for(int x = 0; x < m; x++) {
          if(a[i + y][j + x] != b[y][x]) match = 0;
        }
      }
      if(match) e = 1;
    }
  }
  if(e) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: invalid types 'char[int]' for array subscript
   10 |       cin >> a[i][j];
      |                  ^
a.cc:15:18: error: invalid types 'char[int]' for array subscript
   15 |       cin >> b[i][j];
      |                  ^
a.cc:27:22: error: invalid types 'char[int]' for array subscript
   27 |           if(a[i + y][j + x] != b[y][x]) match = 0;
      |                      ^
a.cc:27:37: error: invalid types 'char[int]' for array subscript
   27 |           if(a[i + y][j + x] != b[y][x]) match = 0;
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int N,M;
    cin>>N>>M;
    string A[N],B[M];

    for(int i=0;i<N;i++)
        cin>>A[i];
    for(int i=0;i<M;i++)
        cin>>B[i];
    bool flag;

    for(int i=0;i<=N-M;i++){
        for(int j=0;j<=N-M;j++){
            flag=true;
            for(int k=0;k<M;k++){
                string sub=A[i+k].substr(j,M);
                if(sub!=B[i+k]){
                    flag=false;
                    break;
                }
            }
            if(flag==true)break;
        }
        if(flag==true)break;
    }
    cout<<(flag?"Yes":"No"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   29 |     cout<<(flag?"Yes":"No"<<endl;
      |                       ~~~~^~~~~~
a.cc:29:33: error: expected ')' before ';' token
   29 |     cout<<(flag?"Yes":"No"<<endl;
      |           ~                     ^
      |                                 )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  string a[n], b[m];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = m; i <= n; i++) {
    for (int j = m; i <= n; j++) {
      bool contains = true;
      for (int k = i - m; k < i; k++) {
        for (int l = j - m; l < j; l++) {
          if (a[k][l] != b[k - i + m][l - j - m]) {
            contains = false;
          }
        }
      }
      if (contains) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:7: error: expected ';' before string constant
   30 |   cout "No" << endl;
      |       ^~~~~
      |       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(a, b) printf(a, b);
#define c(s) cout << (s) << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define cyn(c) cout << (c ? "Yes" : "No") << endl;
#define cYN(c) cout << (c ? "YES" : "NO") << endl;
#define pyn(c) printf("%s\n", c ? "Yes" : "No");
#define pYN(c) printf("%s\n", c ? "YES" : "NO");
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> P;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int main() {
    int n,m; bool ok=false;
    char a[55][55]={},b[55][55]={};
    cin >> n >> m;
    rep(i,n)rep(j,n)cin>>a[i][j];
    rep(i,m)rep(j,m)cin>>b[i][j];

    rep(i,n-m){
        rep(j,n-m){
            bool flag = true;
            rep(k,m){
                rep(l,m){
                    if(a[i+k][j+l]!=b[k][l]){
                        flag = false;
                    }
                }
            }
            if(flag)ok=ture;
        }
    }
    if(ok){
        yes;
    }else{
        no;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:24: error: 'ture' was not declared in this scope
   42 |             if(flag)ok=ture;
      |                        ^~~~