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

#include <deque>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using large = long long;

struct Node {
    int v;
    int distance;

    friend bool operator<(const Node a, const Node b) { return a.distance < b.distance; }
};

static Node extract(vector<Node> &nodes) {
    int index = 0;
    int min_distance = nodes[0].distance;
    for (int i = 1; i < nodes.size(); i++) {
        if (nodes[i].distance < min_distance) {
            min_distance = nodes[i].distance;
            index = i;
        }
    }

    if (index + 1 != nodes.size()) {
        swap(nodes[index], nodes.back());
    }
    auto node = nodes.back();
    nodes.pop_back();
    return node;
}

static large distance(int start, int goal, const std::vector<vector<int>> &connected_from) {
    const auto n = connected_from.size();
    auto touched = vector<char>(n);
    auto closed = vector<char>(n);
    auto nodes = vector<Node>();

    nodes.push_back(Node{start, 0});
    touched[start] = true;

    while (!nodes.empty()) {
        auto node = extract(nodes);
        closed[node.v] = true;

        if (node.v == goal) {
            return node.distance;
        }

        for (auto u : connected_from[node.v]) {
            if (closed[u])
                continue;
            if (!touched[u]) {
                touched[u] = true;
                nodes.push_back(Node{u, node.distance + 1});
                continue;
            }
            auto itr = find_if(nodes.begin(), nodes.end(), [u](auto &n) { return n.v == u; });
            if (itr != nodes.end()) {
                if (node.distance + 1 < itr->distance) {
                    itr->distance = node.distance + 1;
                }
            }
        }
    }

    return -1;
}

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

    auto connected_from = vector<vector<int>>(n);
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        connected_from[u].push_back(v);
    }
    int s, t;
    cin >> s >> t;
    s--, t--;

    auto hop3_from = vector<set<int>>(n);
    for (int v = 0; v < n; v++) {
        for (auto child : connected_from[v]) {      // hop1
            for (auto gc : connected_from[child]) { //  hop2
                for (auto ggc : connected_from[gc]) { // hop3
                    if (v != ggc) {
                        hop3_from[v].insert(ggc);
                    }
                }
            }
        }
    }

    connected_from.resize(n);
    for (int v = 0; v < n; v++) {
        connected_from[v].clear();
        connected_from[v].assign(hop3_from[v].begin(), hop3_from[v].end());
    }

    cout << distance(s, t, connected_from);
    return 0;
}


Compiler output:
a.cc: In function 'large distance(int, int, const std::vector<std::vector<int> >&)':
a.cc:59:24: error: 'find_if' was not declared in this scope
   59 |             auto itr = find_if(nodes.begin(), nodes.end(), [u](auto &n) { return n.v == u; });
      |                        ^~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define sz(x) int (x.size());


using namespace std;
const int MOD=1000000007;
const int INF=1001001001;


int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> to(n);
  rep(i,n){
    int u,v;
    u--;v--;
    cin>>u>>v;
    to[u].push_back(v);
  }
  int s,t;
  cin>>s>>t;
  s--;t--;
  int dist[n][3];
  rep(i,n)(j,3)dist[i][j]=INF;
  dist[s][0]=0;
  queue<P> q;
  q.push(P (s,0));
  while (q!=empty){
    int t1,t2;
    t1=q.front().first;
    t2=q.front().second;
    q.pop();
    for(int t3:to[t1]){
      int nl=(t2+1)%3;
      if (dist[t3][nl]!=INF)continue;
      dist[t3][nl]=dist[t1][t2]+1;
      q.push(P(t3,nl));
    }
  }
  int ans=dist[t][0];
  if (ans==INF)ans=-1;
  else(ans=ans/3);
  cout<<ans;
}


}


Compiler output:
a.cc:3:9: error: 'pair' does not name a type
    3 | typedef pair<int,int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:27:12: error: 'j' was not declared in this scope
   27 |   rep(i,n)(j,3)dist[i][j]=INF;
      |            ^
a.cc:29:9: error: 'P' was not declared in this scope
   29 |   queue<P> q;
      |         ^
a.cc:29:10: error: template argument 1 is invalid
   29 |   queue<P> q;
      |          ^
a.cc:29:10: error: template argument 2 is invalid
a.cc:30:5: error: request for member 'push' in 'q', which is of non-class type 'int'
   30 |   q.push(P (s,0));
      |     ^~~~
a.cc:31:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator!='
   31 |   while (q!=empty){
      |          ~^~~~~~~
a.cc:33:10: error: request for member 'front' in 'q', which is of non-class type 'int'
   33 |     t1=q.front().first;
      |          ^~~~~
a.cc:34:10: error: request for member 'front' in 'q', which is of non-class type 'int'
   34 |     t2=q.front().second;
      |          ^~~~~
a.cc:35:7: error: request for member 'pop' in 'q', which is of non-class type 'int'
   35 |     q.pop();
      |       ^~~
a.cc:40:9: error: request for member 'push' in 'q', which is of non-class type 'int'
   40 |       q.push(P(t3,nl));
      |         ^~~~
a.cc: At global scope:
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	const int N = 1e5 + 5;
	vector<int> a[N];
	int b[N][3], n, m, u, v;
	cin >> n >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> u >> v;
		a[u].push_back(v);
	}
	for (int i = 1; i <= 3; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			b[i][j] = -3;
		}
	}
	int s, t;
	cin >> s >> t;
	queue <pair< int, int >> q;
	b[s][0] = 0;
	q.push({ s,0 });
	while (!q.empty())
	{
		const int cx = q.front().first, cy = q.front().second, ny = (cy + 1) % 3;
		q.pop();
		for (int i = 0; i<int(a[cx].size); i++)
		{
			const int nx = a[cx][i];
			if (b[nx][ny] == -3)
			{
				q.push({ nx,ny });
				b[nx][ny] = b[cx][cy] + 1;
			}
		}
	}
	cout << b[t][0]/3 << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:45: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   31 |                 for (int i = 0; i<int(a[cx].size); i++)
      |                                       ~~~~~~^~~~
      |                                                 ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	const int N = 1e5 + 5;
	vector<int> a[N];
	int b[N][3],n,m,u,v;
	cin >> n >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> u >> v;
		a[u].push_back(v);
	}
	for (int i = 1; i <= 3; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			b[i][j] = -3;
		}
	}
	int s, t;
	cin >> s >> t;
	queue <pair< int, int >> q;
	b[s][0] = 0;
	q.push({ s,0 });
	while (!q.empty())
	{
		const int cx = q.front().first, cy = q.front().second, ny = (cy + 1) % 3;
		q.pop();
		for (int i = 0; i<int(a[cx].size); i++)
		{
			const int nx = a[cx][i];
			if (b[nx][ny] == -3)
			{
				q.push({ nx,ny });
				b[nx][ny] = b[cx][cy] + 1;
			}
		}
	}
	cout << b[t][0] << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:45: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   31 |                 for (int i = 0; i<int(a[cx].size); i++)
      |                                       ~~~~~~^~~~
      |                                                 ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> hen(N);
    
    for (int i = 0; i < M; i++) {
        int u, v;
        cin >> u >> v;
        hen[u-1].push_back(v-1);
    }
    int S, T;
    cin >> S >> T;
    S--;
    T--;
    
    vector<vector<int>> flag(N, vector<int>(3, 0));
    flag[S][0] = 1;
    queue<vector<ll>> que;
    for (int i = 0; i < hen[S].size(); i++) {
        flag[hen[S][i]][1] = 1;
        vector<ll> a = {hen[S][i], 1, 0};
        que.push(a);
    }
    
    ll ans = -1;
    while(!que.empty()) {
        vector<ll> p = que.front();
        que.pop();
        //cout << p[0] << " " << p[1] << " " << p[2] << endl;
        for (int i = 0; i < hen[p[0]].size(); i++) {
            if (p[1] < 2 && flag[hen[p[0]][i]][p[1]+1] == 0) {
                flag[hen[p[0]][i]][p[1]+1] = 1;
                vector<ll> a = {hen[p[0]][i], p[1]+1, p[2]};
                que.push(a);
            }
            else if (p[1] == 2 && flag[hen[p[0]][i]][0] == 0) {
                if (hen[p[0]][i] == T) {
                    ans = p[2]+1;
                    break;
                }
                flag[hen[p[0]][i]][0] = 1;
                vector<ll> a = {hen[p[0]][i], 0, p[2]+1};
                que.push(a);
            }
        if (ans != -1)
            break;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef double db;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> pll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

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

    vvl G(n);
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        G[a].pb(b);
        G[b].pb(a);
    }

    ll sv, tv;
    cin >> sv >> tv;
    sv--;  tv--;

    vvl dist(n, vl(3, -1));  // dist[i][j] : 移動距離がmod3でjとなる頂点svから頂点iまでの最短距離
    queue<pll> Q;

    ll sv = 0;  // BFSを始める頂点(デフォルトでは0)
    dist[sv][0] = 0;
    Q.push(make_pair(sv, 0));
    while(!Q.empty()) {
        ll v = Q.front().first;
        ll c = Q.front().second;
        Q.pop();
        for(auto u : G[v]) {
            ll nc = (c + 1)%3;
            if(dist[u][nc] != -1) {
                continue;
            }
            dist[u][nc] = dist[v][c] + 1;
            Q.push(make_pair(u, nc));
        }
    }

    ll ans = dist[tv][0];

    if(ans != -1) {
        ans /= 3;
    }

    out(ans);
    re0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:8: error: redeclaration of 'll sv'
   48 |     ll sv = 0;  // BFSを始める頂点(デフォルトでは0)
      |        ^~
a.cc:41:8: note: 'll sv' previously declared here
   41 |     ll sv, tv;
      |        ^~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define pb push_back;
const ll mod = 1000000007;

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

    vvl G(n);
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        G[a].pb(b);
    }

    ll sv, tv;
    cin >> sv >> tv;
    sv--;  tv--;

    vvl dist(n, vl(3, -1));  // dist[i][j] : 移動距離がmod3でjとなる頂点svから頂点iまでの最短距離
    queue<pll> Q;

    dist[sv][0] = 0;
    Q.push(make_pair(sv, 0));
    while(!Q.empty()) {
        ll v = Q.front().first;
        ll c = Q.front().second;
        Q.pop();
        for(auto u : G[v]) {
            ll nc = (c + 1)%3;
            if(dist[u][nc] != -1) {
                continue;
            }
            dist[u][nc] = dist[v][c] + 1;
            Q.push(make_pair(u, nc));
        }
    }
    
    ll ans = dist[tv][0];
    if(ans != -1) {
        ans /= 3;
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: statement cannot resolve address of overloaded function
   17 | #define pb push_back;
a.cc:29:14: note: in expansion of macro 'pb'
   29 |         G[a].pb(b);
      |              ^~
Language: Java

import lib.Combination;

import javax.swing.*;
import java.util.*;
import java.util.stream.Collectors;

public class Main {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    // int N = Integer.parseInt(scanner.nextLine());
    // int N = scanner.nextInt(), M = scanner.nextInt();
    // scanner.nextLine();
    // int[] n = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    // long[] n = Arrays.stream(scanner.nextLine().split(" ")).mapToLong(Long::parseLong).toArray();
    static void solve(Scanner scanner) {
        int N = scanner.nextInt(), M = scanner.nextInt();
        scanner.nextLine();
        Map<Integer, Set<Integer>> edges = new HashMap<>();
        for (int i = 1; i <= N; i++) {
            edges.put(i, new HashSet<>());
        }
        for (int i = 0; i < M; i++) {
            int[] e = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            edges.get(e[0]).add(e[1]);
        }
        int S = scanner.nextInt(), T = scanner.nextInt();

        int[][] dist = new int[N + 1][3];
        for (int[] d: dist) {
            Arrays.fill(d, Integer.MAX_VALUE / 2);
        }
        Queue<Long> q = new ArrayDeque<>();
        Set<Long> visited = new HashSet<>();
        q.add(((long) S) << 32);
        while (!q.isEmpty()) {
            long top = q.poll();
            int node = (int) (top >> 32);
            int cost = (int) top;
            int rem = cost % 3;
            if (visited.add((((long) node) << 32) + rem)) {
                dist[node][rem] = cost;
                for (int next: edges.get(node)) {
                    q.add((((long) next) << 32) + cost + 1);
                }
            }
        }

        if (dist[T][0] == Integer.MAX_VALUE / 2) {
            System.out.println(-1);
            return;
        }

        System.out.println(dist[T][0] / 3);
    }

}


Compiler output:
Main.java:1: error: package lib does not exist
import lib.Combination;
          ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>

using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
int N_ = N*3+1;
    vector<int> G[N_];

    for (int i = 0; i < M; i++){
        int u, v; cin >> u >> v;
        G[u].emplace_back(N + v);
        G[N + u].emplace_back(2 * N + v);
        G[2 * N + u].emplace_back(v);
    }
    int S, T;
    cin >> S >> T;

    const int INF = INT_MAX;
    int d[N * 3 + 1];
    fill(d, d + N * 3 + 1, INF);
    d[S] = 0;
    queue<int> q;
    q.push(S);
    while(q.size() != 0){
        int x = q.front(); q.pop();
        if (x == T) break;
        for (auto& y : G[x]){
            if(d[y] != INF) continue;
            d[y] = d[x] + 1;
            q.push(y);
        }
    }

    if (d[T] == INF) d[T] = -1;
    else d[T] /= 3;
    
    cout << d[T] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'INT_MAX' was not declared in this scope
   24 |     const int INF = INT_MAX;
      |                     ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<queue>
  +++ |+#include <climits>
    6 |
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>

using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> G[N * 3 + 1];

    for (int i = 0; i < M; i++){
        int u, v; cin >> u >> v;
        G[u].emplace_back(N + v);
        G[N + u].emplace_back(2 * N + v);
        G[2 * N + u].emplace_back(v);
    }
    int S, T;
    cin >> S >> T;

    const int INF = INT_MAX;
    int d[N * 3 + 1];
    fill(d, d + N * 3 + 1, INF);
    d[S] = 0;
    queue<int> q;
    q.push(S);
    while(q.size() != 0){
        int x = q.front(); q.pop();
        if (x == T) break;
        for (auto& y : G[x]){
            if(d[y] != INF) continue;
            d[y] = d[x] + 1;
            q.push(y);
        }
    }

    if (d[T] == INF) d[T] = -1;
    else d[T] /= 3;
    
    cout << d[T] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: 'INT_MAX' was not declared in this scope
   23 |     const int INF = INT_MAX;
      |                     ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<queue>
  +++ |+#include <climits>
    6 |
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <numeric>
 
using namespace std;
#define ll long long


const int maxn = 1e5+5;
vector<int> adj[maxn];
queue< pair<int, int> > q;  // a fringe
// int counts[maxn];
int dist[maxn][3];


int main() {
 
    ios::sync_with_stdio(false);
    cin.tie(0);

    // fill(counts, counts+maxn, 1e6);
    memset(dist, -1, sizeof(dist));

    int n,m; cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        int u,v; cin >> u >> v;
        adj[u].push_back(v);
    }

    int s,t; cin >> s >> t;
    q.push(make_pair(s, 0));
    dist[s][0] = 0;
    
    while (!q.empty()) {
        int curr = q.front().first, d = q.front().second;
        // tie(curr, d) = q.front();
        q.pop();
        for (int nei : adj[curr]) {
            if (dist[nei][(d+1) % 3] == -1) {
                q.push(make_pair(nei, (d+1) % 3));
                dist[nei][(d+1) % 3] = dist[curr][d] + 1;
            }
        }
    }

    if (dist[t][0] == -1) {
        cout << -1 << endl;
    } else {
        cout << dist[t][0] / 3 << endl;
    }

}
 



Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'memset' was not declared in this scope
   36 |     memset(dist, -1, sizeof(dist));
      |     ^~~~~~
a.cc:18:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   17 | #include <numeric>
  +++ |+#include <cstring>
   18 |
Language: C++

#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
const ll inf=(1e18);
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
struct edge{ll to,cost;};
vector<vector<edge>> graph;
vector<int> d1;
int n,m;
int s,t;
void dijkstra(ll s){
    d1.resize(3*n);
    for(int i=0;i<3*n;i++)d1[i]=INT_MAX;//訪れていない頂点をinfで初期化
    d1[s]=0;
    priority_queue<P,vector<P>,greater<P>> q;
    q.push(P(0,s));//始点を０で置く
    while(!q.empty()){
        P a=q.top();
        q.pop();
        if(d1[a.se]<a.fi)continue;
        for(int i=0;i<graph[a.se].size();i++){
            edge e=graph[a.se][i];
            if(d1.at(e.to)>d1[a.se]+e.cost){
                d1.at(e.to)=d1[a.se]+e.cost;//訪れていないorより低いコストの経路を発見した時、値を更新
                q.push(P(d1[e.to],e.to));//コストの低いところ優先のbfs
            }
        }
    }
}
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
   cin>>n>>m;
   graph.resize(3*n);
   for(int i=0;i<m;i++){
       int a,b;
       cin>>a>>b;
       a--;b--;
       graph[a].push_back(edge{b+n,1});
       graph[a+n].push_back(edge{b+2*n,1});
       graph[a+2*n].push_back(edge{b,1});
   }
   cin>>s>>t;
   //t=t+2*n;
   s--;t--;
   dijkstra(s);
   if(d1[t]==INTMAX){
       cout<<-1<<endl;
   }
   else cout<<d1[t]/3<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:14: error: 'INTMAX' was not declared in this scope; did you mean 'INT_MAX'?
   56 |    if(d1[t]==INTMAX){
      |              ^~~~~~
      |              INT_MAX
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=100000+10;

int n,m;
int s,t;
vector<int> a[maxn*3];
int q[maxn*3],front,rear;
int d[maxn*3];
int kq;

int main(){
  scanf("%d%d",&n,&m);
  for(int i=1;i<=m;i++){
    int u,v;
    scanf("%d%d",&u,&v);
    a[u*3+0].push_back(v*3+1);
    a[u*3+1].push_back(v*3+2);
    a[u*3+2].push_back(v*3+0);
  }
  scanf("%d%d",&s,&t);
  //--------
  front=1;rear=0;
  for(int i=0;i<3*(n+1);i++) d[i]=-1;
  rear++;q[rear]=s*3+0;d[s*3+0]=0;
  while(front<=rear){
    int u=q[front];front++;
//    cout<<"U= "<<u<<endl;
    for(int i=0;i<a[u].size();i++){
      int v=a[u][i];
      if (d[v]==-1){
//        cout<<"---------> V= "<<v<<endl;
        rear++;q[rear]=v;d[v]=d[u]+1;
      }
    }
  }
  if (d[t*3+0]==-1) kq=-1;
  else kq=d[t*3+0]/3;
  cout<<kq;
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> a[maxn*3];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:19:5: error: 'a' was not declared in this scope
   19 |     a[u*3+0].push_back(v*3+1);
      |     ^
a.cc:31:19: error: 'a' was not declared in this scope
   31 |     for(int i=0;i<a[u].size();i++){
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
ll inf=10000000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
int main(){
  int n,m;cin>>n>>m;
  vi v(n*3,inf);
  vvi g(n*3);
  rep(i,m){
    ll a,b;cin>>a>>b;a--;b--;
    rep(j,3)g[a*3+j].push_back(b*3+(j+1)%3);
  }
  ll s,t;cin>>s>>t;s--;t--;
  v[s+0]=0;
  queue<ll> q;
  q.push(s+0);
  while(!q.empty()){
    ll a=q.front();
    q.pop();
    for(auto i:g[a]){
      if(v[i]==inf){
        v[i]=v[a][b]+1;
        q.push(i);
      }
    }
  }
  if(v[n-1][0]==inf)cout<<-1<<endl;
  else cout<<v[t][0]/3<<endl;
}


Compiler output:
a.cc:17:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   17 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |            ^~~~
a.cc:17:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   17 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |                    ^~~~
a.cc:18:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |            ^~~~
a.cc:18:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:36:19: error: 'b' was not declared in this scope
   36 |         v[i]=v[a][b]+1;
      |                   ^
a.cc:41:12: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   41 |   if(v[n-1][0]==inf)cout<<-1<<endl;
      |            ^
a.cc:42:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   42 |   else cout<<v[t][0]/3<<endl;
      |                  ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define Rep(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
int main(){
  int n,m;cin>>n>>m;
  vvi v(n,vi(3,inf));
  vector<vector<vector<P>>> g(n,vector<vector<P>>(3));
  rep(i,m){
    int a,b;cin>>a>>b;a--;b--;
    g[a][0].push_back(P(b,1));
    g[a][1].push_back(P(b,2));
    g[a][2].push_back(P(b,0));
  }
  int s,t;cin>>s>>t;s--;t--;
  queue<P> q;
  q.push(P(s,0));
  while(!q.empty()){
    int a=q.top().first,b=q.top().second;
    q.pop();
    for(auto i:g[a][b]){
      if(v[i.first][i.second]==inf){
        v[i.first][i.second]=v[a][b]+1;
        q.push(i);
      }
    }
  }
  if(v[n-1][0]==inf)cout<<-1<<endl;
  else cout<<v[n-1][0]<<endl;
}


Compiler output:
a.cc:18:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |            ^~~~
a.cc:18:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |                    ^~~~
a.cc:19:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   19 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |            ^~~~
a.cc:19:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   19 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:34:13: error: 'class std::queue<std::pair<long long int, long long int> >' has no member named 'top'; did you mean 'pop'?
   34 |     int a=q.top().first,b=q.top().second;
      |             ^~~
      |             pop
a.cc:36:21: error: 'b' was not declared in this scope
   36 |     for(auto i:g[a][b]){
      |                     ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)

struct edge{
    int to;
    long long cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<long long, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[300'010];//頂点iから出る辺の配列G[i]の配列。
int dist[300'010];//特定の頂点から各頂点への距離が格納される。
bool used[300'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        long long d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    int n,m;
    cin >> n >> m;
    int u,v;
    int s,t;
    REP(i,m){
        cin>>u>>v;
        u--;v--;
        REP(j,3){
          G[u+j*n].push_back(edge(1, v+((j+1)%3)*n));
          G[v+((j+1)%3)*n].push_back(edge(1, u+j*n));
        }
    }
    cin>>s>>t;
    s--;t--;
    dijkstra(s);
    if(used[t]){
      cout<<dist[t]/3<<endl;
    }else{
      cout<<-1<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:51: error: no matching function for call to 'edge::edge(int, int)'
   52 |           G[u+j*n].push_back(edge(1, v+((j+1)%3)*n));
      |                                                   ^
a.cc:6:8: note: candidate: 'edge::edge()'
    6 | struct edge{
      |        ^~~~
a.cc:6:8: note:   candidate expects 0 arguments, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:53:51: error: no matching function for call to 'edge::edge(int, int)'
   53 |           G[v+((j+1)%3)*n].push_back(edge(1, u+j*n));
      |                                                   ^
a.cc:6:8: note: candidate: 'edge::edge()'
    6 | struct edge{
      |        ^~~~
a.cc:6:8: note:   candidate expects 0 arguments, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)

struct edge{
    int to;
    long long cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<long long, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[300'010];//頂点iから出る辺の配列G[i]の配列。
int dist[300'010];//特定の頂点から各頂点への距離が格納される。
bool used[300'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        long long d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    int n,m;
    cin >> n >> m;
    int u,v;
    int s,t;
    REP(i,m){
        cin>>u>>v;
        u--;v--;
        REP(j,3){
          G[u+j*n].push_back(edge(v+((j+1)%3)*n, 1));
          G[v+((j+1)%3)*n].push_back(edge(u+j*n, 1));
        }
    }
    cin>>s>>t;
    s--;t--;
    dijkstra(s);
    if(used[t]){
      cout<<dist[t]/3<<endl;
    }else{
      cout<<-1<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:51: error: no matching function for call to 'edge::edge(int, int)'
   52 |           G[u+j*n].push_back(edge(v+((j+1)%3)*n, 1));
      |                                                   ^
a.cc:6:8: note: candidate: 'edge::edge()'
    6 | struct edge{
      |        ^~~~
a.cc:6:8: note:   candidate expects 0 arguments, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:53:51: error: no matching function for call to 'edge::edge(int, int)'
   53 |           G[v+((j+1)%3)*n].push_back(edge(u+j*n, 1));
      |                                                   ^
a.cc:6:8: note: candidate: 'edge::edge()'
    6 | struct edge{
      |        ^~~~
a.cc:6:8: note:   candidate expects 0 arguments, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
a.cc:6:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:6:8: note:   candidate expects 1 argument, 2 provided
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
static const int INFTY=2147483648;
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define MAX 300005
int n,m,M[MAX][MAX],color[MAX],d[MAX];
vector <pair<int,int> > adj[MAX];
void dijkstra(int s,int t){
    priority_queue <pair<int,int> > PQ;
    d[3*s]=0;
    color[3*s]=GRAY;
    PQ.push(make_pair(0,3*s));
    while(!PQ.empty()){
        pair<int,int> f=PQ.top();
        PQ.pop();
        int u=f.second;
        color[u]=BLACK;
        if(d[u]<f.first*(-1)) continue;

        for(int j=0;j<adj[u].size();j++){
            int v=adj[u][j].first;
            if(color[v]==BLACK) continue;
            if(d[v]>d[u]+adj[u][j].second){
                d[v]=d[u]+adj[u][j].second;
                PQ.push(make_pair(d[v]*(-1),v));
                color[v]=GRAY;
            }
        }
    }
    cout<<(d[3*t]==INFTY ? -1:d[3*t])<<endl;
}
int main(){
    int u,v,s,t;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>u>>v;
        adj[3*(u-1)].push_back(make_pair(3*(v-1)+1,1));
        adj[3*(u-1)+1].push_back(make_pair(3*(v-1)+2,1));
        adj[3*(u-1)+2].push_back(make_pair(3*(v-1),1));
    }
    for(int i=0;i<3*n;i++){
        color[i]=WHITE;
        d[i]=INFTY;
    }
    cin>>s>>t;
    dijkstra(s,t);
    return 0;
}

Compiler output:
/tmp/ccVKovsc.o: in function `dijkstra(int, int)':
a.cc:(.text+0x33): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0xd6): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0xf1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x127): relocation truncated to fit: R_X86_64_PC32 against symbol `adj' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x153): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x173): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x18a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x1a8): relocation truncated to fit: R_X86_64_PC32 against symbol `adj' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x1e2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccVKovsc.o
a.cc:(.text+0x1ff): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

int main() {
    int N, M, S, T;
    cin >> N >> M;
    vector<int>v(M);
    vector<int>u(M);
    for (int i = 0; i < M; ++i) {
      cin >> u[i] >> v[i];
    }
    cin >> S >> T;

    vector<int> graph[N+1];
    for (int i = 0; i < M; ++i) {
        graph[u[i]].push_back(v[i]);
    }

    // 各頂点にmod 3の初到達時刻fptの情報を持たせてBFS
    vector<vector<int>> fpt(N+1, vector<int>(3, -3));
    queue<pair<int, int>> que;
    que.push(make_pair(S, 0));
    fpt[S][0] = 0;
    while (! que.empty()){
        auto top = que.top();
        que.pop();
        int modT = (top.second + 1) % 3;
        for (int x : graph[top.first]) {
            if(fpt[x][modT] == -3){
                fpt[x][modT] = fpt[top.first][top.second] + 1;
                que.push(make_pair(x, modT));
            }
        }
    }
    cout << fpt[T][0] / 3 << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   26 |         auto top = que.top();
      |                        ^~~
      |                        pop
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>

bool edgeOrg[100001][100001];
bool edgeKen[100001][100001];
std::queue<int> q;

int main(){
    int level[100001] = {};
    bool marked[100001]= {};
    int n,m,u,v,s,t;
    scanf(" %d %d",&n,&m);
    for(int i = 0;i<m;i++){
        scanf(" %d %d",&u,&v);
        edgeOrg[u-1][v-1] = true;
    }
//    printf("%d %d\n",n,m);
    for(int i = 0;i<n;i++){
//        printf("i=%d\n",i);
        for(int j = 0;j<n;j++){
//            printf("\tj=%d\n",j);
            if(i==j || !(edgeOrg[i][j])) continue;
            for(int k = 0;k<n;k++){
//                printf("\t\tk=%d\n",k);
                if(j==k || !(edgeOrg[j][k])) continue;
                for (int l = 0; l <n ; ++l) {
//                    printf("\t\t\t\tl=%d\n",l);
                    if(l==k || !(edgeOrg[k][l])) continue;
                    if(i != l) edgeKen[i][l] = true;
//                    printf("YAY %d %d\n ",i,l);
                }
            }
        }
    }
    scanf(" %d %d",&s,&t);
    s--;t--;
    q.push(s);
    level[s] = 0;
    marked[s]= true;
    int p;
//    for(int i = 0;i<n;i++){
//        for (int j = 0; j < n; ++j) {
//            if(edgeKen[i][j]) printf("1 ");
//        }
////        printf("\n");
//    }
    while (!q.empty()){
        p = q.front();
        q.pop();
        for(int i = 0;i<n;i++){
            if(!marked[i] && edgeKen[p][i]){
                q.push(i);
                level[i] = level[p]+1;
                marked[i] = true;
                if(i == t) {printf("%d",level[i]);return 0;}
            }
        }
    }
    printf("-1");
    return 0;
}

Compiler output:
/tmp/ccfQYdtk.o: in function `main':
a.cc:(.text+0x1b9): relocation truncated to fit: R_X86_64_PC32 against symbol `edgeKen' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x264): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x29b): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x2af): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x300): relocation truncated to fit: R_X86_64_PC32 against symbol `edgeKen' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x31f): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x3bb): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
/tmp/ccfQYdtk.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x3f4): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
a.cc:(.text+0x40d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccfQYdtk.o
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>

using Graph = std::vector<std::vector<int>>;

void dfs(const Graph& g, std::vector<int>& dp, int vc, int count) {
  for (auto&& vi : g[vc]) {
    for (auto&& vj : g[vi]) {
      for (auto&& vk : g[vj]) {
        if (dp[vk] > count) {
          dp[vk] = count;
          dfs(g, dp, vk, count + 1);
        }
      }
    }
  }
}

int main() {
  int n, m;
  std::cin >> n >> m;

  Graph g(n);
  for (int i = 0; i < m; ++i) {
    int u, v;
    std::cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }

  int s, t;
  std::cin >> s >> t;
  s -= 1;
  t -= 1;

  std::vector<int> dp(n, INT_MAX);
  dfs(g, dp, s, 1);
  const auto ans = dp[t] == INT_MAX ? -1 : dp[t];
  std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: 'INT_MAX' was not declared in this scope
   37 |   std::vector<int> dp(n, INT_MAX);
      |                          ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 |
Language: C++

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

#define L 100003*3
long long dis[L];

void solve(long long N, long long M, std::vector<long long>& U, std::vector<long long>& V, long long S, long long T){
    memset(dis, -1, sizeof(dis));
    dis[S] = 0;
    queue<long long> Q;
    Q.push(S);
    while (!Q.empty()) {
        auto v = Q.front();
        Q.pop();
        for (int i = 0; i < U.size(); i++) {
            auto s = U[i];
            auto t = V[i];
            if (s == v) {
                long long& d = dis[t];
                if (d < 0) {
                    Q.push(t);
                    d = dis[v] + 1;
                }
            }
        }
    }
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> u(M);
    std::vector<long long> v(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&u[i]);
        scanf("%lld",&v[i]);
    }
    long long S;
    scanf("%lld",&S);
    long long T;
    scanf("%lld",&T);

    std::vector<long long> U(M * 3);
    std::vector<long long> V(M * 3);
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < 3; j++) {
            U[i * 3 + j] = u[i] * 3 + j;
            V[i * 3 + j] = v[i] * 3 + (j + 1) % 3;
        }
    }
    
    N *= 3, M *= 3, S *= 3, T *= 3;
    solve(N, M, std::move(U), std::move(V), S, T);

    cout << (dis[T] < 0 ? -1 : dis[T] / 3) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:26: error: cannot bind non-const lvalue reference of type 'std::vector<long long int>&' to an rvalue of type 'std::remove_reference<std::vector<long long int>&>::type' {aka 'std::vector<long long int>'}
   56 |     solve(N, M, std::move(U), std::move(V), S, T);
      |                 ~~~~~~~~~^~~
a.cc:7:62: note:   initializing argument 3 of 'void solve(long long int, long long int, std::vector<long long int>&, std::vector<long long int>&, long long int, long long int)'
    7 | void solve(long long N, long long M, std::vector<long long>& U, std::vector<long long>& V, long long S, long long T){
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

void erase_overlap(vector<int> &vec) {
	sort(vec.begin(), vec.end());
	vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

void kenken(const vector<vector<int>> &graph, vector<vector<int>> &kenkenGraph, int now) {
	vector<int> second;
	for(int next: graph[now]) {
		//cout << "nxt " << next << endl;
		for(int i: graph[next]) second.push_back(i);
	}
	// 重複を消す
	erase_overlap(second);

	for(int sec: second) {
		//cout << "sec " << sec << endl;
		for(int i: graph[sec]) kenkenGraph[now].push_back(i);
	}
	erase_overlap(kenkenGraph[now]);


	//再帰処理 //時間かかるメモリ死ぬのでやめる．
	// for(int j: third) {
	// 	if(seen[j]) continue;
	// 	kenken(graph, kenkenGraph, seen, j);
	// }

	return;
}

int main() {
	// input
	int N, M, S, T;
	cin >> N >> M;
	vector<vector<int>> graph(N);
	rep(i, M) {
		int u, v;
		cin >> u >> v;
		u--; v--;
		graph[u].push_back(v);
		//graph[v].push_back(u); // 有向グラフなので逆方向は記録しない
	}
	cin >> S >> T;
	S--; T--;

	vector<vector<int>> kenkenGraph(N);
	vector<bool> seen(N, false);
	rep(i, N) {
		kenken(graph, kenkenGraph, seen, i);
	}

	// cout << "kenkenGraph: " << endl;
	// rep(i, N) {
	// 	cout << i << ": ";
	// 	rep(j, kenkenGraph[i].size()) {
	// 		cout << kenkenGraph[i][j] << ' ';
	// 	}
	// 	cout << endl;
	// }

	// kenkenGraph の最短路問題
	// bfs
	vector<int> len(N, -1); // startからの最短距離
	queue<int> q;
	q.push(S);
	len[S] = 0;
	
	while(!q.empty()) {
		int p = q.front();
		q.pop();
		for(auto c: kenkenGraph[p]) {
			if(len[c]>=0) continue;
			len[c] = len[p]+1;
			q.push(c);
		}
	}
	
	// cout << "len:" << endl;
	// rep(i, N) {
	// 	cout << i << ": " << len[i] << endl;
	// }

	cout << len[T] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:44: error: cannot convert 'std::vector<bool>' to 'int'
   64 |                 kenken(graph, kenkenGraph, seen, i);
      |                                            ^~~~
      |                                            |
      |                                            std::vector<bool>
a.cc:21:85: note:   initializing argument 3 of 'void kenken(const std::vector<std::vector<int> >&, std::vector<std::vector<int> >&, int)'
   21 | void kenken(const vector<vector<int>> &graph, vector<vector<int>> &kenkenGraph, int now) {
      |                                                                                 ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[4]={0,1,0,-1},mdy[4]={-1,0,1,0};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n,m;
vector<int> uv[100100];
int s,t;
int cost[100100];
int mid1[100100];
int mid2[100100];
int main(){
	cin>>n>>m;
	REP(i,100100)cost[i]=-1;
	REP(i,100100)mid1[i]=-1;
	REP(i,100100)mid2[i]=-1;
	for(int i=0;i<m;i++){
		int t1,s1;
		cin>>t1>>s1;
		uv[t1].push_back(s1);
	}
	cin>>s>>t;
	cost[s]=0;
	queue<int> q;
	q.push(s);
	while(q.size()){
		int now=q.front();q.pop();
		//cout<<"1 :"<<now<<endl;
		vector<int> v1;
		vector<int> v2;
		v1.clear();
		v2.clear();
		for(int i=0;i<uv[now].size();i++){
			//cout<<v1[i]<<endl;
			if(mid1[uv[now][i]]==-1){
				v1.push_back(uv[now][i]);
				mid1[uv[now][i]=1;
			}
		}
		//REP(i,v1.size())cout<<v1[i]<<endl;
		for(int i=0;i<v1.size();i++){
			for(int j=0;j<uv[v1[i]].size();j++){
				if(mid2[uv[v1[i]][j]==-1){
					v2.push_back(uv[v1[i]][j]);
					mid2[uv[v1[i]][j]]=1;
				}
			}
		}
		v1.clear();
		//REP(i,v2.size())cout<<v2[i]<<endl;
		for(int i=0;i<v2.size();i++){
			for(int j=0;j<uv[v2[i]].size();j++)
				v1.push_back(uv[v2[i]][j]);
		}
		//REP(i,v1.size())cout<<v1[i]<<endl;
		for(int i=0;i<v1.size();i++){
			if(cost[v1[i]]==-1){
				q.push(v1[i]);
				cost[v1[i]]=cost[now]+1;
			}
		}
	}
	cout<<cost[t]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:50: error: expected ']' before ';' token
   59 |                                 mid1[uv[now][i]=1;
      |                                                  ^
      |                                                  ]
a.cc:65:57: error: expected ']' before ')' token
   65 |                                 if(mid2[uv[v1[i]][j]==-1){
      |                                                         ^
      |                                                         ]