Language: C++

include <bits/stdc++.h>

#define MAX 100005

using namespace std;

int n, m, s, t;
vector<int> G[MAX];
bitset<MAX> mark;

int bfs()
{
        queue<pair<int,int>> q;
        int ls = 0;
        int kkp = 0;
        q.emplace(s,0);

        while (!q.empty()) {
                auto curr = q.front();
                q.pop();
                if (curr.second != 3) {
                        kkp += (ls == 3);
                        ls = curr.second;

                        for (auto e : G[curr.first])
                                q.emplace(e, curr.second+1);
                } else {
                        if (curr.first == t) return kkp+1;
                        else if (mark[curr.first]) continue;

                        ls = curr.second;
                        mark.set(curr.first);
                        for (auto e : G[curr.first])
                                q.emplace(e, 1);
                }
        }
        return -1;
}

int main()
{
        cin >> n >> m;
        for (int i = 0; i < m; i++) {
                int u, v;
                cin >> u >> v;
                G[u].push_back(v);
        }
        cin >> s >> t;
        mark.reset();
        cout << bfs() << endl;
        return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<int> G[MAX];
      | ^~~~~~
a.cc:9:1: error: 'bitset' does not name a type
    9 | bitset<MAX> mark;
      | ^~~~~~
a.cc: In function 'int bfs()':
a.cc:13:9: error: 'queue' was not declared in this scope
   13 |         queue<pair<int,int>> q;
      |         ^~~~~
a.cc:13:15: error: 'pair' was not declared in this scope
   13 |         queue<pair<int,int>> q;
      |               ^~~~
a.cc:13:20: error: expected primary-expression before 'int'
   13 |         queue<pair<int,int>> q;
      |                    ^~~
a.cc:16:9: error: 'q' was not declared in this scope
   16 |         q.emplace(s,0);
      |         ^
a.cc:25:39: error: 'G' was not declared in this scope
   25 |                         for (auto e : G[curr.first])
      |                                       ^
a.cc:29:34: error: 'mark' was not declared in this scope
   29 |                         else if (mark[curr.first]) continue;
      |                                  ^~~~
a.cc:32:25: error: 'mark' was not declared in this scope
   32 |                         mark.set(curr.first);
      |                         ^~~~
a.cc:33:39: error: 'G' was not declared in this scope
   33 |                         for (auto e : G[curr.first])
      |                                       ^
a.cc: In function 'int main()':
a.cc:42:9: error: 'cin' was not declared in this scope
   42 |         cin >> n >> m;
      |         ^~~
a.cc:46:17: error: 'G' was not declared in this scope
   46 |                 G[u].push_back(v);
      |                 ^
a.cc:49:9: error: 'mark' was not declared in this scope
   49 |         mark.reset();
      |         ^~~~
a.cc:50:9: error: 'cout' was not declared in this scope
   50 |         cout << bfs() << endl;
      |         ^~~~
a.cc:50:26: error: 'endl' was not declared in this scope
   50 |         cout << bfs() << endl;
      |                          ^~~~