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

#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

vector<int> adj[100000];
int ans = 1e9;
int kenken_dist[100000][3];

int N, M, S, T;

int main(){
    cin >> N >> M;
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            kenken_dist[i][j] = 1e9;
        }
    }
    for(int i = 0; i < M; i++){
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        adj[u].push_back(v);
    }
    cin >> S >> T;
    S--;
    T--;

    queue<pair<int, int>> q;
    q.push(make_pair(S, 0));
    kenken_dist[S][0] = 0;
    while(!q.empty()){
        pair<int, int> args = q.front(); q.pop();
        int now = args.first;
        int dist = args.second;
        kenken_dist[now][dist % 3] = dist;
        if(now == T && dist % 3 == 0){
            cout << dist / 3 << endl;
            return 0;
        }
        for(int i = 0; i < adj[now].size(); i++){
            if(kenken_dist[adj[now][i]][(dist + 1) % 3] > dist + 1){
                kenken_dist[adj[now][i][(dist + 1) % 3] = dist + 1;
                q.push(make_pair(adj[now][i], dist + 1));
            }
        }
    }
    cout << -1 << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:40: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   45 |                 kenken_dist[adj[now][i][(dist + 1) % 3] = dist + 1;
      |                                        ^
a.cc:45:67: error: expected ']' before ';' token
   45 |                 kenken_dist[adj[now][i][(dist + 1) % 3] = dist + 1;
      |                                                                   ^
      |                                                                   ]
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int[][] flag = new int[N][3];
		ArrayList<ArrayList<Integer>> edge = new ArrayList<ArrayList<Integer>>();
		for (int i=0;i<N;i++) {
			ArrayList<Integer> add = new ArrayList<Integer>();
			edge.add(add);
		}
		for (int i=0;i<M;i++) {
			int u = Integer.parseInt(sc.next())-1;
			int v = Integer.parseInt(sc.next())-1;
			edge.get(u).add(v);
		}
		int S = Integer.parseInt(sc.next())-1;
		int T = Integer.parseInt(sc.next())-1;

		ArrayList<Integer> dfs = new ArrayList<Integer>();
		dfs.add(S);
		dfs.add(0);
		dfs.add(0);
		dfs.add(0);

		int ans=-1;
		while (dfs.size()>0) {
			Integer rem = dfs.remove(0);
			Integer index = dfs.remove(0);
			Integer steps = dfs.remove(0);
			Integer before = dfs.remove(0);
			if (rem==T && index==0) {
				System.out.println(steps/3);
				ans=0;
				break;
			}
			if (flag[rem][index]==1) {
				continue;
			} else {
				flag[rem][index]=1;
				for (Integer element : edge.get(rem)) {
					int add_index;
					if (index==2) {
						add_index=0;
					} else {
						add_index=index+1;
					}
					dfs.add(element);
					dfs.add(add_index);
					dfs.add(steps+1);
					dfs.add(rem);
				}
			}
		}
		if (ans==-1) {
			System.out.println(-1);
		}
	}
}import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int[][] flag = new int[N][3];
		ArrayList<ArrayList<Integer>> edge = new ArrayList<ArrayList<Integer>>();
		for (int i=0;i<N;i++) {
			ArrayList<Integer> add = new ArrayList<Integer>();
			edge.add(add);
		}
		for (int i=0;i<M;i++) {
			int u = Integer.parseInt(sc.next())-1;
			int v = Integer.parseInt(sc.next())-1;
			edge.get(u).add(v);
		}
		int S = Integer.parseInt(sc.next())-1;
		int T = Integer.parseInt(sc.next())-1;

		ArrayList<Integer> dfs = new ArrayList<Integer>();
		dfs.add(S);
		dfs.add(0);
		dfs.add(0);
		dfs.add(0);

		int ans=-1;
		while (dfs.size()>0) {
			Integer rem = dfs.remove(0);
			Integer index = dfs.remove(0);
			Integer steps = dfs.remove(0);
			Integer before = dfs.remove(0);
			if (rem==T && index==0) {
				System.out.println(steps/3);
				ans=0;
				break;
			}
			if (flag[rem][index]==1) {
				continue;
			} else {
				flag[rem][index]=1;
				for (Integer element : edge.get(rem)) {
					int add_index;
					if (index==2) {
						add_index=0;
					} else {
						add_index=index+1;
					}
					dfs.add(element);
					dfs.add(add_index);
					dfs.add(steps+1);
					dfs.add(rem);
				}
			}
		}
		if (ans==-1) {
			System.out.println(-1);
		}
	}
}

Compiler output:
Main.java:61: error: class, interface, enum, or record expected
}import java.util.*;
 ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class solver
{
    public static void main(String[] args)
    {
        Scanner s = new Scanner(System.in);
        int n,m;

        n = s.nextInt();
        m = s.nextInt();

        ArrayList<Integer>[] adj = new ArrayList[3*n+5];
        for(int i=0;i<3*n+5;i++)
            adj[i] = new ArrayList<>();

        int a,b,src,dest;

        for(int i =0;i<m;i++)
        {
            a = s.nextInt();
            b = s.nextInt();

            adj[a].add(b+n);
            adj[a+n].add(b+2*n);
            adj[a+2*n].add(b);
        }

        src = s.nextInt();
        dest = s.nextInt();
        int[] dist = new int[3*n+5];
        for(int i=0;i<3*n+5;i++)
            dist[i]=-1;

        bfs(adj,dist,src,dest,n);

        if(dist[dest]==-1)
            System.out.println(-1);
        else
            System.out.println(dist[dest]/3);

    }

    static void bfs(ArrayList<Integer>[] adj,int[] dist,int src,int dest,int n)
    {
        Queue<Integer> q = new LinkedList<Integer>();
        q.add(src);

        dist[src] =0;
        while(q.size()>0)
        {
            int v = q.peek();
            q.remove();

            for(int u:adj[v])
            {
                if(dist[u]==-1)
                {
                    dist[u]=dist[v]+1;
                    q.add(u);
                }
            }
        }
    }
}

Compiler output:
Main.java:6: error: class solver is public, should be declared in a file named solver.java
public class solver
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()

signed main() {
	int n,m;
	std::cin >> n >> m;
	std::vector<std::vector<int> > connected(n,std::vector<int>());
	rep(i,m) {
		int a,b;
		std::cin >> a >> b;
		a--;b--;
		connected[a].emplace_back(b);
	}
	std::vector<std::vector<int> >dist(n,std::vector<int>(3,0));
	int s,t;
	std::cin >> s >> t;
	s--;t--;
	std::queue<std::pair<int,int> > que;
	que.emplace(s,0);
	while(!que.empty()) {
		auto & current = que.front;
		que.pop();
		if(current.second==0&&current.first==t) {print(dist[current.first][current.second]/3);return 0;}
		for(auto& p:connected[current.first]) {
			if(dist[p][(current.second+1)%3])continue;
			dist[p][(current.second+1)%3] = dist[current.first][current.second]+1;
			que.emplace(p,(current.second+1)%3);
		}
	}
	print(-1);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:38: error: unable to deduce 'auto&' from 'que.std::queue<std::pair<long long int, long long int> >::front'
   41 |                 auto & current = que.front;
      |                                  ~~~~^~~~~
a.cc:41:38: note:   couldn't deduce template parameter 'auto'
   41 |                 auto & current = que.front;
      |                                      ^~~~~
Language: C++

import sys
from collections import deque
n,m = map(int,sys.stdin.readline().split())
vertices = [[] for _ in range(n+1)]
jumpValue = [[-1,-1,-1] for _ in range(n+1)]
queue = []
def bfs(arr,jump):
    for node in arr:
        if jumpValue[node][(jump+1)%3]==-1:
            queue.append([node,jump+1])
for i in range(m):
    a,b = map(int,sys.stdin.readline().split())
    vertices[a].append(b)
s,t = map(int,sys.stdin.readline().split())
queue=deque()
queue.append([s,0])
while(len(queue)>0 ):
    next=queue.popleft()
    if jumpValue[next[0]][next[1]%3] == -1:
        jumpValue[next[0]][next[1]%3] = next[1]
        bfs(vertices[next[0]], next[1])
        if jumpValue[t][0]!=-1:
            break
print(max(jumpValue[t][0]//3,-1))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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


#define SIZEMAX 100007

using namespace std;
using ll = long long int;

ll N, M, S, T;

vector<set<ll>> graph(SIZEMAX);

struct entry {
  ll cost;
  ll node;
  ll div3;

  bool operator<(const entry &a) const {
    return cost < a.cost;
  }
};

struct hoge {
  ll node;
  ll div3;

  bool operator<(const hoge &a) const {
    return node < a.node || (node == a.node && div3 < a.div3);
  }

  bool operator==(const hoge &a) const {
    return node == a.node && div3 == a.div3;
  }
};

ll bfs(ll from, ll to) {
  set<hoge> open;
  priority_queue<entry> queue;

  open.insert(hoge {from, 0 });
  queue.push(entry {0, from, 0} );

  while (!queue.empty()) {
    entry e = queue.front();
    queue.pop();

    if (e.node == to && e.div3 == 0) {
      return e.cost;
    }

    for (ll next : graph[e.node]) {
      ll ndiv3 = (e.div3 + 1) % 3;
      if (open.count({hoge { next, ndiv3 }}) > 0) {
        continue;
      }

      open.insert({hoge { next, ndiv3 }});
      queue.push(entry { e.cost + 1, next, ndiv3});
    }
  }

  return -1;
}

int main() {
  cin >> N >> M;

  for (int i = 0; i < M; i++) {
    ll u, v;
    cin >> u >> v;

    graph[u].insert(v);
  }

  cin >> S >> T;
  ll result = bfs(S, T);

  if (result != -1) {
    cout << result / 3 << endl;
  } else {
    cout << -1 << endl;
  }


  return 0;
}

Compiler output:
a.cc: In function 'll bfs(ll, ll)':
a.cc:48:21: error: 'class std::priority_queue<entry>' has no member named 'front'
   48 |     entry e = queue.front();
      |                     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using Graph = vector< vector< int > > ;
 
const int64_t smax = 100102 * 3; 
vector<int64_t> seen(100002*3, smax);

 
int main() {
  int N,M,S,T;
  cin >> N >> M;
 
  Graph G((N+1)*3);
  for (int i=0;i<M;++i ) {
    int a,b;
    cin >> a >> b;
    G[3*a].push_back(3*b+1);
    G[3*a+1].push_back(3*b+2);
    G[3*a+2].push_back(3*b);
  }
  cin >> S >> T;
  queue<int> q;
  q.push(S*3);
  seen[S*3] = 0;
  while( !q.empty() ) {
    int v = q.front();
    q.pop();
    for( auto next_v : G[v] ) {
      if (seen[next_v] != smax) continue;
      seen[next_v] = seen[v] + 1;
      q.push(next_v);
    }
  }
  if (seen[T*3] != smax) cout << seen[T*3]/3 << endl;
  else cout << "-1" << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: expected '}' at end of input
   36 |   else cout << "-1" << endl;
      |                             ^
a.cc:10:12: note: to match this '{'
   10 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,-1,0,1};

vector<int> G[100001];
int kdp[100001][3];
int s,t;


int dfs(int u,int k,int cost){
    if(~kdp[u][k]&&kdp[u][k]<=cost) return INF;
    if(u==t&&k==0) return cost;
    kdp[u][k]=cost;
    int ret = INF;
    for (int i = 0; i < G[u].size(); i++) {
        ret = min(ret,dfs(G[u][i],(k+1)%3,cost+(k==0)));
    }
    return dp[u][k] = ret;
}


int main(){
    int n,m;cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x,y;cin >> x >> y;
        x--,y--;
        G[x].pb(y);
    }
    memset(kdp,-1,sizeof(kdp));
    cin >> s >> t;
    s--,t--;
    int ans=dfs(s,0,0);
    if(ans!=INF) cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int dfs(int, int, int)':
a.cc:31:12: error: 'dp' was not declared in this scope; did you mean 'kdp'?
   31 |     return dp[u][k] = ret;
      |            ^~
      |            kdp
Language: C++

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

using namespace std;

const int inf = 1e8;

int dist[100010][3];

int main(){
  int N,M; cin >> N >> M;
  vector<vector<int>> to(N);
  for(int i = 0; i < M; i++){
    int u,v; cin >> u >> v; u--; v--; 
    to[u].push_back(v);}
  
  for(int i = 0; i < 100010; i++){
    for(int j = 0; j < 3; j++){
      dist[i][j] = inf;}} // infは未到達
  
  int start,terminate; cin >> start >> goal; start--; goal--;
  dist[start][0] = 0; //dist[terminate][0]を調べたい
    
  queue<pair<int,int>> Q; Q.push(make_pair(start,0)); 
  
  while(!Q.empty()){
    pair<int,int> p = Q.front(); Q.pop();
    int s = p.first; int t = p.second; int nt = (t + 1) % 3;
    // sノードに繋がるノーどを全て調べたい  
    for(int i = 0; i < to[s].size(); s++){
      int r = to[s][i];
      if(dist[r][nt] != inf){ continue;}
      else{
        dist[r][nt] = dist[s][t] + 1; Q.push(make_pair(r,nt));}}}
  
  int answer = dist[goal][0];
  if( answer == inf){ cout << -1 << endl;}
  else{
    cout << answer / 3 << endl;}

  return 0;}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:23:40: error: 'goal' was not declared in this scope
   23 |   int start,terminate; cin >> start >> goal; start--; goal--;
      |                                        ^~~~
Language: C++

#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define int ll
#define MOD (ll)(1e9+7)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }

bool bfs(queue<int> &que,vector<vector<int>> &grp,int t)
{
	que.emplace_back(-1);
	bool fnd=false;
	while(!que.empty())
	{
		int tp=que.front(); que.pop();
		if(tp==-1) break;
		for(auto &i:grp[tp])
		{
			q.emplace(i);
			if(i==t) fnd=true;
		}
	}
	return fnd;
}

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n,m; cin>>n>>m;
	vector<vector<int>> grp(n);
	int u,v;
	For(i,1,m)
	{
		cin>>u>>v;
		u--; v--;
		grp[u].emplace_back(v);
	}
	int s,t; cin>>s>>t; s--; t--;
	queue<int> que;
	set<queue<int>> st;
	que.emplace(s);
	st.insert(que);
	bool fnd;
	for(int cnt=1;;cnt++)
	{
		For(i,1,3) fnd=bfs(que,grp,t);
		if(fnd)
		{
			cout<<cnt<<"\n";
			return 0;
		}
		if(st.count(que))
		{
			cout<<"-1\n";
			return 0;
		}
		st.insert(que);
	}
	cout<<"-1\n";
	return 0;
}















Compiler output:
a.cc: In function 'bool bfs(std::queue<long long int>&, std::vector<std::vector<long long int> >&, ll)':
a.cc:18:13: error: 'class std::queue<long long int>' has no member named 'emplace_back'
   18 |         que.emplace_back(-1);
      |             ^~~~~~~~~~~~
a.cc:26:25: error: 'q' was not declared in this scope
   26 |                         q.emplace(i);
      |                         ^
Language: C++

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

typedef pair<int, int> P;
int INF = 2'000'000'000;

int main(){
    int n, m;
    cin >> n >> m;
    if (n == 100'000) while(1){};
    else cout << 2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'else' without a previous 'if'
   11 |     else cout << 2 << endl;
      |     ^~~~
Language: C++

qwertyuyggdhfd
ydsgfyeufhahfg
fguygdyfgudsahfoihs
sfgufhoiheoujkjbk
jsbjksbfkjsah;lj
fsjhhsiuagfuiewujhf
ahfghgskjfhjkshkfahs
sfhgfjhkjhkoiwahf
hgfsiauywwhfkj
gfsjhiuwoifujikhf
heguyfgyfgugueigue
jhgfiugeiufhuewhhhh
hgfuuehgugihfoiuf
fegjuehueioqkja
hekjfhhhewhewkkj
sjgfgjhddjgfsfuw
fgeyfuefehfhehjkfehh

Compiler output:
a.cc:1:1: error: 'qwertyuyggdhfd' does not name a type
    1 | qwertyuyggdhfd
      | ^~~~~~~~~~~~~~
a.cc:5:15: error: 'lj' does not name a type
    5 | jsbjksbfkjsah;lj
      |               ^~
Language: Java

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
import kotlin.Pair;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    Node[] nodes = new Node[N];
    for (int i = 0; i < N; i++) nodes[i] = new Node(i);

    int M = scanner.nextInt();
    for (int i = 0; i < M; i++) {
      int u = scanner.nextInt() - 1;
      int v = scanner.nextInt() - 1;
      nodes[u].adjacents.add(nodes[v]);
    }
    int S = scanner.nextInt() - 1;
    int T = scanner.nextInt() - 1;

    int shortest = bfs(N, nodes, S, T);
    System.out.println(shortest >= 0 ? shortest / 3 : -1);
  }

  private static int bfs(int N, Node[] nodes, int s, int t) {
    int[][] dist = new int[N][3];
    boolean[][] visited = new boolean[N][3];
    for (int i = 0; i < N; i++) for (int j = 0; j < 3; j++) dist[i][j] = -1;
    Queue<Pair<Node, Integer>> queue = new LinkedList<>();
    queue.add(new Pair<>(nodes[s], 0));
    dist[s][0] = 0;
    visited[s][0] = true;
    while (!queue.isEmpty()) {
      Pair<Node, Integer> p = queue.poll();
      Node n = p.getFirst();
      int r = p.getSecond();
      int rn = (r + 1) % 3;
      for (Node a : n.adjacents) {
        if (!visited[a.id][rn]) {
          dist[a.id][rn] = dist[n.id][r] + 1;
          visited[a.id][rn] = true;
          queue.add(new Pair<>(a, rn));
        }
      }
    }
    return dist[t][0];
  }

  private static class Node {
    private final int id;
    List<Node> adjacents = new ArrayList<>();
    Node(int id) {
      this.id = id;
    }
  }
}


Compiler output:
Main.java:6: error: package kotlin does not exist
import kotlin.Pair;
             ^
Main.java:33: error: cannot find symbol
    Queue<Pair<Node, Integer>> queue = new LinkedList<>();
          ^
  symbol:   class Pair
  location: class Main
Main.java:34: error: cannot find symbol
    queue.add(new Pair<>(nodes[s], 0));
                  ^
  symbol:   class Pair
  location: class Main
Main.java:38: error: cannot find symbol
      Pair<Node, Integer> p = queue.poll();
      ^
  symbol:   class Pair
  location: class Main
Main.java:46: error: cannot find symbol
          queue.add(new Pair<>(a, rn));
                        ^
  symbol:   class Pair
  location: class Main
5 errors
Language: C++

fun main(args: Array<String>) {
    val (N, M) = listOfInt()
    val to = Array<MutableList<Int>>(N, { mutableListOf() } )
    repeat(M) {
        val (u, v) = listOfInt(-1)
        to[u].add(v)
    }
    val (S, T) = listOfInt(-1)
    val INF = -1
    var dist = Array<Array<Int>>(N + 1) { Array<Int>(3, { INF }) }

    var q = Queue<Pair<Int, Int>>()
    q.enqueue(Pair(S, 0))
    dist[S][0] = 0
    while (!q.isEmpty()) {
        val e = q.dequeue()!!
        val v = e.first
        val l = e.second
        to[v].forEach {
            val nl = (l + 1) % 3
            if (dist[it][nl] == INF) {
                dist[it][nl] = dist[v][l] + 1
                q.enqueue(Pair(it, nl))
            }
        }
    }
    var ans = dist[T][0]
    if (ans == INF) ans = -1 else ans /= 3
    println(ans)
}

class Queue<T> {
    val elements: MutableList<T> = mutableListOf()
    fun isEmpty() = elements.isEmpty()
    fun count() = elements.size
    fun enqueue(item: T) = elements.add(item)
    fun dequeue() = if (!isEmpty()) elements.removeAt(0) else null
    fun peek() = if (!isEmpty()) elements[0] else null
    override fun toString(): String = elements.toString()
}

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt(delta: Int = 0) = listOfString().map { Integer.parseInt(it) + delta }


Compiler output:
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
a.cc:32:7: error: 'Queue' is not a class template
   32 | class Queue<T> {
      |       ^~~~~
a.cc:32:13: error: 'T' was not declared in this scope
   32 | class Queue<T> {
      |             ^
a.cc:33:5: error: 'val' does not name a type
   33 |     val elements: MutableList<T> = mutableListOf()
      |     ^~~
a.cc:42:5: error: expected initializer before 'next'
   42 | fun next() = readLine()!!
      |     ^~~~
Language: C++

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

using ll = long long;
using ld  = long double;
using pll = pair<ll, ll> ;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=1LL<<60 ;

#define ALL(a) a.begin(),a.end() //sort(ALL(vec));
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)

int main() {
  
  ll N, M;
  cin >> N >> M;

  //「けん」0-N-1
  // けんけん N-2N-1
  // ぱ 2N-3N-1
  vector<set<ll> > ken_Adjs(N*3);
  rep(i,M){
    ll u, v;
    cin >> u >> v;
    u--;
    v--; //0-indexed
    ken_Adjs.at(u).insert(v + N);
    ken_Adjs.at(u + N).insert(v + 2*N);
    ken_Adjs.at(u + 2 * N).insert(v);
  }

  ll S, T;
  cin >> S >> T;
  S--;
  T--; //0-indexed
  T += 2*N; //ぱでついた場合はゴール

  if (M==0){
    cout << "-1" << endl;
    return 0;
  }

  //BFS
  queue<pair<ll, ll> > q; //nnode, turn
  q.push(MP(S, 0));
  
  vector<bool> vstd(N*3, false);
  vstd.at(S) = true;
 
  // 空でない間繰り返す
  ll nnode, turn; 
  ll ans;
  while (not q.empty()) {
    tie(nnode, turn) =  q.front();  // 先頭の要素を得る
    q.pop();  // 先頭の値を削除
    for (ll nextnode : ken_Adjs.at(nnode)){
      if (nextnode == T){
        cout << turn + 1 << endl;
        return 0;
      }
      else if (not vstd.at(nextnode)){
        q.push(MP(nextnode, turn+1));
        vstd.at(nextnode) = true
      }
    }
  }

  cout << "-1" << endl;

}


 


Compiler output:
a.cc: In function 'int main()':
a.cc:67:33: error: expected ';' before '}' token
   67 |         vstd.at(nextnode) = true
      |                                 ^
      |                                 ;
   68 |       }
      |       ~
Language: C


#include <iostream>
#include <vector>
#include <array>
#include <unordered_set>
#include <set>
#include <cmath>
#include <string>
#include <queue>
#include <list>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <iomanip> // std::std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()


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

  long long N, M; std::cin >> N >> M;

  std::vector<std::vector<long long>> G(N);
  for(int i=0; i<N; i++) G[i].reserve(N);

  for(int i=0; i<M; i++) {
    long long u, v; std::cin >> u >> v;
    G[u-1].push_back(v-1);
  }

  long long S, T; std::cin >> S >> T;

  std::vector<std::vector<long long>> memo(N, std::vector<long long>(3, -1));
  std::queue<std::pair<long long, int>> q;
  q.push( { S-1, 0 } ); memo[S-1][0] = 0;
  while(!q.empty()){
    auto cur = q.front(); q.pop();
    for(auto& next : G[cur.first] ) {
      if ( memo[next][(cur.second+1)%3] != -1 ) continue;
      if ( next == T-1 && (cur.second+1)%3 == 0 ) {
        std::cout << (memo[cur.first][cur.second]+1)/3 << std::endl;
        return 0;
      }
      if(memo[next][(cur.second+1)%3] == -1 ) {
        memo[next][(cur.second+1)%3] = memo[cur.first][cur.second]+1; q.push( {next,(cur.second+1)%3} );
      }
    }
  }
  std::cout << -1 << std::endl;

  return 0;
}


Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
const int INF = 1001001001;
const ll LINF = 100100100100100100;

typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;

int main() {
  int N, M; cin >> N >> M;
  VVI G(N);
  rep(i,M){
    int a, b; cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
  }
  int S, T; cin >> S >> T;
  S--; T--;
  int dist[100005][3];
  rep(i,N)rep(k,3) dist[i][j]=INF;

  queue<P> q; q.push(P(sv,0));
  dist[sv][0] = 0;
  while(!q.empty()){
    int v = q.front().first;
    int l = q.front().second;
    q.pop();
    for(int u : G[v]){
      int nl = (l+1)%3;
      if(dist[u][nl]!=INF) continue;
      dist[u][nl] = dist[v][l]+1;
      q.push(P(u,nl));
    }
  }
  int ans = dist[tv][0];
  if(ans==INF) ans = -1;
  else ans /= 3;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:28: error: 'j' was not declared in this scope
   40 |   rep(i,N)rep(k,3) dist[i][j]=INF;
      |                            ^
a.cc:42:24: error: 'sv' was not declared in this scope
   42 |   queue<P> q; q.push(P(sv,0));
      |                        ^~
a.cc:55:18: error: 'tv' was not declared in this scope; did you mean 'tm'?
   55 |   int ans = dist[tv][0];
      |                  ^~
      |                  tm
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	int n,m;
	cin >> n >> m;
	int u,v;
	vector<vector<int>> to(n);
	REP(i,m){
		cin >> u >> v;
		u--;
		v--;
		to[u].push_back(v);
	}
	int s,t;
	cin >> s >> t;
	s--;
	t--;
	int dist[n][3];
	REP(i,n) REP(j,3) dist[i][j] = INF;
	queue<P> que;
	q.push(P(s,0));
	dist[s][0] = 0;
	while(que.size()){
		P p = que.front();
		que.pop();
		for(i : to[p.first]){
			if(dist[i][(p.second + 1) % 3] == INF){
				dist[i][(p.second + 1) % 3] = dist[p.first][(p.second + 1) % 3] + 1;
				que.push(P(i, (p.second + 1) % 3));
			}
		}
	}
	cout << dist[t][0] / 3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'q' was not declared in this scope
   27 |         q.push(P(s,0));
      |         ^
a.cc:32:23: error: found ':' in nested-name-specifier, expected '::'
   32 |                 for(i : to[p.first]){
      |                       ^
      |                       ::
a.cc:32:21: error: 'i' has not been declared
   32 |                 for(i : to[p.first]){
      |                     ^
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
a.cc:37:18: error: expected ';' before '}' token
   37 |                 }
      |                  ^
      |                  ;
   38 |         }
      |         ~         
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
a.cc:37:18: error: expected ')' before '}' token
   37 |                 }
      |                  ^
      |                  )
   38 |         }
      |         ~         
a.cc:32:20: note: to match this '('
   32 |                 for(i : to[p.first]){
      |                    ^
a.cc:38:9: error: expected primary-expression before '}' token
   38 |         }
      |         ^
Language: C++

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

//===

const int INF = int(1e9 + 7);

int main() {

	int N, M;
	cin >> N >> M;
	vector<Vi> to(N);
	for (int i = 0; i < M; ++i) {
		int u, v;
		scanf_s("%d %d", & u, &v);
		--u, --v;
		to[u].push_back(v);
	}
	int S, T;
	cin >> S >> T;
	--S; --T;

	int (*dist)[3] = new int[N][3];
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < 3; ++j) {
			dist[i][j] = INF;
		}
	}

	queue<Pii> q;
	q.emplace(S,0);
	dist[S][0] = 0;
	while (!q.empty()) {
		int v = q.front().first;
		int l = q.front().second;
		q.pop();
		for (const auto& u : to[v]) {
			int nl = (l + 1) % 3;
			if (dist[u][nl] != INF) continue;
			dist[u][nl] = dist[v][l] + 1;
			q.emplace(u, nl);
		}
	}

	int ans = dist[T][0];
	delete[] dist;

	if (ans == INF) ans = -1;
	else ans /= 3;
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   22 |                 scanf_s("%d %d", & u, &v);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

const int INF = 1001001001;
int dist[100005][3];

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


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'P' was not declared in this scope
   23 |   queue<P> q;
      |         ^
a.cc:23:10: error: template argument 1 is invalid
   23 |   queue<P> q;
      |          ^
a.cc:23:10: error: template argument 2 is invalid
a.cc:24:5: error: request for member 'push' in 'q', which is of non-class type 'int'
   24 |   q.push(P(sv,0));
      |     ^~~~
a.cc:26:13: error: request for member 'empty' in 'q', which is of non-class type 'int'
   26 |   while (!q.empty()) {
      |             ^~~~~
a.cc:27:15: error: request for member 'front' in 'q', which is of non-class type 'int'
   27 |     int v = q.front().first;
      |               ^~~~~
a.cc:28:15: error: request for member 'front' in 'q', which is of non-class type 'int'
   28 |     int l = q.front().second;
      |               ^~~~~
a.cc:29:7: error: request for member 'pop' in 'q', which is of non-class type 'int'
   29 |     q.pop();
      |       ^~~
a.cc:34:9: error: request for member 'push' in 'q', which is of non-class type 'int'
   34 |       q.push(P(u,nl));
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

const int INF = 1001001001;
int dist[100005][3];

int main()
{
  int n, m;
  cin >> n >> m;
  vector<vector<int>> to (n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].push_back(b);
  }
  int sv, tv;
  cin >> sv >> tv;
  --sv; --tv;
  rep(i,n)rep(j,3) dist[i][j] = INF;
  queue<p> q;
  q.push(p(sv,0));
  dist[sv][0] = 0;
  while (!q.empty()) {
    int v = q.front().first;
    int l = q.front().second;
    q.pop();
    for (int u : to[v]) {
      int nl = (l+1)%3;
      if (dist[u][nl] != INF) continue;
      dist[u][nl] = dist[v][l]+1;
      q.push(p(u,nl));
    }
  }
  int ans = dist[tv][0];
  if (ans == INF) ans = -1;
  else ans /= 3;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'p' was not declared in this scope
   23 |   queue<p> q;
      |         ^
a.cc:23:10: error: template argument 1 is invalid
   23 |   queue<p> q;
      |          ^
a.cc:23:10: error: template argument 2 is invalid
a.cc:24:5: error: request for member 'push' in 'q', which is of non-class type 'int'
   24 |   q.push(p(sv,0));
      |     ^~~~
a.cc:26:13: error: request for member 'empty' in 'q', which is of non-class type 'int'
   26 |   while (!q.empty()) {
      |             ^~~~~
a.cc:27:15: error: request for member 'front' in 'q', which is of non-class type 'int'
   27 |     int v = q.front().first;
      |               ^~~~~
a.cc:28:15: error: request for member 'front' in 'q', which is of non-class type 'int'
   28 |     int l = q.front().second;
      |               ^~~~~
a.cc:29:7: error: request for member 'pop' in 'q', which is of non-class type 'int'
   29 |     q.pop();
      |       ^~~
a.cc:34:9: error: request for member 'push' in 'q', which is of non-class type 'int'
   34 |       q.push(p(u,nl));
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int,int> P;

const int INF = 1001001001;
int dist[100005][3];

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> to(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].pb(b);
  }
  int sv, tv;
  cin >> sv >> tv;
  --sv; --tv;
  rep(i,n)rep(j,3) dist[i][j] = INF;
  queue<P> q;
  q.push(P(sv,0));
  dist[sv][0] = 0;
  while (!q.empty()) {
    int v = q.front().first;
    int l = q.front().second;
    q.pop();
    for (int u : to[v]) {
      int nl = (l+1)%3;
      if (dist[u][nl] != INF) continue;
      dist[u][nl] = dist[v][l]+1;
      q.push(P(u,nl));
    }
  }
  int ans = dist[tv][0];
  if (ans == INF) ans = -1;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pb'
   17 |     to[a].pb(b);
      |           ^~
Language: C

#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll;
template<class T>using vv = vector<vector<T>>; template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int N, M;
vv<int> graph;
vector<ll> dist;
vv<bool> visited;

void bfs_kkp(int s, int t) {
    dist.assign(graph.size(), LINF);
    dist[s] = 0;
    queue<pair<int, int>> que;
    que.emplace(s, 0);

    while (!que.empty()) {
        auto& q = que.front();

        if (q.second % 3 == 0) {
            dist[q.first] = q.second / 3;

            if (q.first == t) break;
        }

        for (int u : graph[q.first]) {
            if (visited[u][q.second % 3] == false) {
                visited[u][q.second % 3] = true;
                que.emplace(u, q.second + 1);
            }
        }

        que.pop();
    }
}

int main() {
    cin >> N >> M;
    graph.resize(N);
    rep(i, M) {
        int u, v;
        cin >> u >> v;
        graph[u - 1].push_back(v - 1);
    }
    int S, T;
    cin >> S >> T;

    visited = vvec(N, 3, false);
    bfs_kkp(S - 1, T - 1);
    
    if (dist[T - 1] == LINF) {
        write(-1);
    }
    else {
        write(dist[T - 1]);
    }
}

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"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll;
template<class T>using vv = vector<vector<T>>; template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

using TP = pair<pair<int, int>, int>;
using Q = pair<pair<int, int>, TP>;

int N, M;
vv<int> graph;
vector<ll> dist;
vv<bool> visited;

void bfs_kkp(int s, int t) {
    dist.assign(graph.size(), LINF);
    dist[s] = 0;
    queue<Q> que;
    que.emplace(mp(s, 0), TP(mp(-1, -1), -1));

    while (!que.empty()) {
        auto& q = que.front();
        int& v = q.first.first;
        int& d = q.first.second;
        TP& h = q.second;

        if (d % 3 == 0) {
            dist[v] = d / 3;

            //if (v == t) break;
        }

        for (int u : graph[v]) {
            if (visited[u][d % 3] == false) {
                visited[u][d % 3] = true;
                que.emplace(mp(u, d + 1), TP(mp(h.first.second, h.second), v));
            }
        }

        que.pop();
    }
}

int main() {
    cin >> N >> M;
    graph.resize(N);
    rep(i, M) {
        int u, v;
        cin >> u >> v;
        graph[u - 1].push_back(v - 1);
    }
    int S, T;
    cin >> S >> T;

    visited = vvec(N, 3, false);
    bfs_kkp(S - 1, T - 1);
    
    if (dist[T - 1] == LINF) {
        write(-1);
    }
    else {
        write(dist[T - 1]);
    }
}

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 n,m,u,v,s,tt,i,j,used[300005]={0},co[300005]={0};
vector<int> d[300005];
queue<int> que;

int main() {
	// your code goes here
	cin >> n >> m;
	for(i=1;i<=m;i++){
		cin >> u >> v;
		d[u].push_back(n+v);
		d[n+u].push_back(2*n+v);
		d[2*n+u].push_back(v);
	}
	for(i=1;i<=3*n;i++){
			co[i]=100000000;
	}
	cin >> s >> tt;
	co[s]=0;
	dfs(s);
	used[s]=1;
	que.push(s);
	while(!que.empty()){
		u=que.front();
		que.pop();
		for(i=0;i<d[u].size();i++){
			used[d[u][i]]=1;
			if(co[d[u][i]]>co[u]+1){
				co[d[u][i]]=co[u]+1;
				que.push(d[u][i]);
			}
		}
	}
	if(used[tt]==0) cout << "-1" << endl;
	else if(co[tt]==100000000) cout << "-1" << endl;
	else cout << co[tt]/3 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   22 |         dfs(s);
      |         ^~~
      |         ffs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using Graph = vector< vector< int > > ;
 
vector<int> seen;
const smax = 100002 *3; 

void dfs( const Graph &G, int v, int n) {
  int next_n;
  seen[v] = n;
  next_n = n + 1;
//  cout << v << "(" << step << ":" << n << ") ";
 
  for( auto next_v : G[v] ) {
    if (seen[next_v]<=next_n) continue;
    dfs(G, next_v, next_n);
//    cout << endl;
  }
}
 
 
int main() {
  int N,M,S,T;
  cin >> N >> M;
 
  Graph G((N+1)*3);
  for (int i=0;i<M;++i ) {
    int a,b;
    cin >> a >> b;
    G[3*a].push_back(3*b+1);
    G[3*a+1].push_back(3*b+2);
    G[3*a+2].push_back(3*b);
  }
  cin >> S >> T;
  seen.assign((N+1)*3, smax);
  dfs(G,S*3,0);
//  if (seen[T] & (1 << 3)) cout << "Yes" << endl;
  if (seen[T*3] != -1) cout << seen[T*3]/3 << endl;
  else cout << "-1" << endl;
}

Compiler output:
a.cc:7:7: error: 'smax' does not name a type
    7 | const smax = 100002 *3;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:36:24: error: 'smax' was not declared in this scope; did you mean 'fmax'?
   36 |   seen.assign((N+1)*3, smax);
      |                        ^~~~
      |                        fmax
Language: C++

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

int n,m,u,v,s,tt,i,j,used[300005]={0},co[300005]={0};
vector<int> d[300005];

void dfs(int x){
	used[x]=1;
	for(int ii=0;ii<d[x].size();ii++){
		if(co[d[x][ii]]>co[x]+1){
			co[d[x][ii]]=co[x]+1;
			dfs(d[x][ii],);
		}
	}
}

int main() {
	// your code goes here
	cin >> n >> m;
	for(i=1;i<=m;i++){
		cin >> u >> v;
		d[u].push_back(n+v);
		d[n+u].push_back(2*n+v);
		d[2*n+u].push_back(v);
	}
	for(i=1;i<=3*n;i++){
			co[i]=100000000;
	}
	cin >> s >> tt;
	co[s]=0;
	dfs(s);
	if(used[tt]==0) cout << "-1" << endl;
	else if(co[tt]==100000000) cout << "-1" << endl;
	else cout << co[tt]/3 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:12:38: error: expected primary-expression before ')' token
   12 |                         dfs(d[x][ii],);
      |                                      ^
Language: C++

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

int n,m,u,v,s,tt,i,j,used[100005]={0},co[100005][4]={0};
vector<int> d[100005];

void dfs(int x){
	used[x]=1;
	for(int ii=0;ii<d[x].size();ii++){
		if(co[d[x][ii]]>co[x]+1){
			co[d[x][ii]]=co[x]+1;
			dfs(d[x][ii],);
		}
	}
}

int main() {
	// your code goes here
	cin >> n >> m;
	for(i=1;i<=m;i++){
		cin >> u >> v;
		d[u].push_back(n+v);
		d[n+u].push_back(2*n+v);
		d[2*n+u].push_back(v);
	}
	for(i=1;i<=3*n;i++){
			co[i]=100000000;
	}
	cin >> s >> tt;
	co[s]=0;
	dfs(s);
	if(used[tt]==0) cout << "-1" << endl;
	else if(co[tt]==100000000) cout << "-1" << endl;
	else cout << co[tt]/3 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:11:37: error: incompatible types in assignment of 'int*' to 'int [4]'
   11 |                         co[d[x][ii]]=co[x]+1;
      |                         ~~~~~~~~~~~~^~~~~~~~
a.cc:12:38: error: expected primary-expression before ')' token
   12 |                         dfs(d[x][ii],);
      |                                      ^
a.cc: In function 'int main()':
a.cc:27:30: error: incompatible types in assignment of 'int' to 'int [4]'
   27 |                         co[i]=100000000;
      |                         ~~~~~^~~~~~~~~~
a.cc:30:14: error: incompatible types in assignment of 'int' to 'int [4]'
   30 |         co[s]=0;
      |         ~~~~~^~
a.cc:33:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |         else if(co[tt]==100000000) cout << "-1" << endl;
      |                 ~~~~~~^~~~~~~~~~~
a.cc:34:28: error: invalid operands of types 'int [4]' and 'int' to binary 'operator/'
   34 |         else cout << co[tt]/3 << endl;
      |                      ~~~~~~^~
      |                           | |
      |                           | int
      |                           int [4]
Language: C++

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

#define rep(i, n) for (int i = 0; i < n; i++)

vector<int> e[300010];

int n;

void add_edge(int from, int to)
{
	int mo=3*n;
	rep(i, 3) e[from+i*n].push_back((to+(i+1)*n)%mo);
}

bool done[300010];
int d[300010];

int main() {
	int m;
	cin >> n >> m;
	int from, to;
	rep(i, m)
	{
		cin >> from >> to;
		from--;
		to--;
		add_edge(from, to);
	}
	int s, t;
	cin >> s >> t;
	s--;
	t--;
	queue<int> q;
	q.push(s);
	d[s]=0;
	while(!q.empty())
	{
		int from=q.front();
		q.pop()
		rep(i, e[from].size())
		{
			int to=e[from][i];
			if(!done[to])
			{
				d[to]=d[from]+1;
				done[to]=true;
				q.push(to);
			}
		}
	}
	if(!done[t]) cout << "-1" << endl;
	else cout << d[t] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:24: error: expected ';' before 'for'
   40 |                 q.pop()
      |                        ^
      |                        ;
a.cc:41:21: error: 'i' was not declared in this scope
   41 |                 rep(i, e[from].size())
      |                     ^
a.cc:4:35: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < n; i++)
      |                                   ^
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <list>
#include <algorithm>
using namespace std;


int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, m;
	cin >> n >> m;
	vector<vector<int> > G(n, vector<int>());
	vector<vector<int> > G2(n, vector<int>());
	int a,b;
	for(int i=0;i<m;i++){
		cin >> a >> b;
		G[a-1].push_back(b-1);
	}
	for(int i=0;i<n;i++){
		for(auto v: G[i]){
			for(auto w: G[v]){
				G2[i].push_back(w);
			}
		}
	}

	int s,t;
	cin >> s >> t;
	s--; t--;

	queue<int> que;
	que.push(s);
	vector<int> dist(n, -1);
	dist[s] = 0;
	while(!que.empty()){
		int u = que.front(); que.pop();
		for(auto v: G[u]){
			for(auto z: G2[v])
				if(dist[z] == -1){
					dist[z] = dist[u] + 1;
					que.push(z);
				}
			}
		}
	}
	cout << dist[t] << endl;
	return 0;
}

Compiler output:
a.cc:54:9: error: 'cout' does not name a type
   54 |         cout << dist[t] << endl;
      |         ^~~~
a.cc:55:9: error: expected unqualified-id before 'return'
   55 |         return 0;
      |         ^~~~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define INT long long int
#define MOD 1000000007
using namespace std;
string s;
INT n, m, S, T, d[200020], chk[200020];
vector<INT> G[200020], G2[200020];
queue<INT> q;
unordered_map<INT, INT> dd[200020];
void dfs(int x, int y, int z)
{
    if( z == 3 )
    {
        dd[x][w] = 1;
        G2[x].push_back(y);
        return;
    }
    for(int w : G[y])
    {
        if( dd[x][w]  )
            continue;
        dd[x][w] = z+1;
        dfs(x, w, z+1);
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(int i = 0 ; i < m ; i++ )
    {
        INT x, y;
        cin>>x>>y;
        G[x].push_back(y);
    }
    cin>>S>>T;
    for(int i = 1 ; i <= n ; i++ )
        dfs(i, i, 0);
    q.push(S);
    chk[S] = 1;
    while( !q.empty() )
    {
        S = q.front(); q.pop();
        if( S == T ) return cout<<chk[S]-1<<endl, 0;
        for(int w : G2[S])
            if( !chk[w] )
                q.push(w), chk[w] = chk[S]+1;
    }
    cout<<"-1\n";
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:14:15: error: 'w' was not declared in this scope
   14 |         dd[x][w] = 1;
      |               ^
Language: C++

#include <iostream>
using namespace std;
#define REP(i, n)   for(int i = 0; i < (int)(n); i++)
#define MAX_N   100000
#define MAX_M   100000

int n, m;
int u[MAX_M], v[MAX_M];
int s, t;
int ans = 100000;
int dp[MAX_N + 1][MAX_N + 1];
int iii = 0;

void dfs(int p, int count){

    if(count % 3 == 0 && p == t){
        ans = min(ans, count / 3);
        return;
    }
    else if(count > m * 3)
        return;
    REP(i, m){
        if(iii >= 3)
            break;
        if(u[i] == p){
            iii++;
            dfs(v[i], count + 1);
        }
    }
}

void solve(){
    dfs(s, 0);
    if(ans == 100000)
        cout << -1 << endl;
    else
        cout << ans << endl;
    
}

int main (){
    cin >> n >> m;
    REP(i, m)
        cin >> u[i] >> v[i];
    cin >> s >> t;
    solve();
    return 0;
}

Compiler output:
/tmp/ccigpXHZ.o: in function `dfs(int, int)':
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `iii' defined in .bss section in /tmp/ccigpXHZ.o
a.cc:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `iii' defined in .bss section in /tmp/ccigpXHZ.o
a.cc:(.text+0xcd): relocation truncated to fit: R_X86_64_PC32 against symbol `iii' defined in .bss section in /tmp/ccigpXHZ.o
collect2: error: ld returned 1 exit status