Language: C++

#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <cmath>
using namespace std;

typedef long long llong;
typedef unsigned long long ullong;
// -2.1e-9 <= int <= 2.1e9
// 0 <= unsigned int <= 4.2e9

//bool Map[3][3];
//int A[3][3];

void find(int v, vector<vector<int>>& A, vector<vector<bool>>& Map)
{
    for (size_t i=0; i<3; i++) {
        for (size_t j=0; j<3; j++) {
            if (v == A[i][j]) Map[i][j] = true;
        }
    }
}

int main()
{
    //bool Map[3][3];
    //int A[3][3];
    vector<vector<bool>> Map(3, vector<bool>(3, false));
    vector<vector<int>> A(3, vector<int>(3, 0));

    for (size_t i=0; i<3; i++) {
        for (size_t j=0; j<3; j++) {
            cin >> A[i][j];
            Map[i][j] = false;
        }
    }
    size_t N; cin >> N;
    for (size_t i=0; i<N; i++) {
        int b; cin >> b;
        find(b, A, Map);
    }

    for (size_t i=0; i<3; i++) {
        bool judge = true;
        for (size_t j=0; j<3; j++) {
            if (Map[i][j] == false) {
                judge = false;
            }
        }
        if (judge == true) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    for (size_t j=0; j<3; j++) {
        bool judge = true;
        for (size_t i=0; i<3; i++) {
            if (Map[i][j] == false) {
                judge = false;
            }
        }
        if (judge == true) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    bool judge = true;
    for (int i=0; i<3; i++) {
        if (Map[i][i] == false) {
            judge = false;
        }
    }
    if (judge == true) {
        cout << "Yes" << endl;
        return 0;
    }

    judge = true;
    for (int i=0; i<3; i++) {
        int k = 2 - i;
        if (Map[i][k] == false) {
            judge = false;
        }
    }
    if (judge == true) {
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'cin' was not declared in this scope
   35 |             cin >> A[i][j];
      |             ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <cmath>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:39:15: error: 'cin' was not declared in this scope
   39 |     size_t N; cin >> N;
      |               ^~~
a.cc:39:15: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:13: error: 'cout' was not declared in this scope
   53 |             cout << "Yes" << endl;
      |             ^~~~
a.cc:53:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:30: error: 'endl' was not declared in this scope
   53 |             cout << "Yes" << endl;
      |                              ^~~~
a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    6 | #include <cmath>
  +++ |+#include <ostream>
    7 | using namespace std;
a.cc:66:13: error: 'cout' was not declared in this scope
   66 |             cout << "Yes" << endl;
      |             ^~~~
a.cc:66:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:66:30: error: 'endl' was not declared in this scope
   66 |             cout << "Yes" << endl;
      |                              ^~~~
a.cc:66:30: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:78:9: error: 'cout' was not declared in this scope
   78 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:78:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:78:26: error: 'endl' was not declared in this scope
   78 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:78:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:90:9: error: 'cout' was not declared in this scope
   90 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:90:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:90:26: error: 'endl' was not declared in this scope
   90 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:90:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:94:5: error: 'cout' was not declared in this scope
   94 |     cout << "No" << endl;
      |     ^~~~
a.cc:94:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:94:21: error: 'endl' was not declared in this scope
   94 |     cout << "No" << endl;
      |                     ^~~~
a.cc:94:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'