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

#include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], top=0;
vector<int> G[MAX];


void dfs(int r, int c) {
  stack<int> S;
  int i, v, u;
  S.push(r);
  color[r]=c;
  while (! S.empty()) {
    u=S.top();
    S.pop();
    for (i=0; i<G[u].size(); i++) {
        v=G[u][i];
      if (color[v]==NIL) {
        color[v]=c;
        S.push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  cin >> n >> m;

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

  cin >> q;

  for (i=0; i<q; i++) {
    cin >> s >> t;
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude<stack>
      |  ^~~~~~~
      |  include
a.cc:10:13: error: conflicting declaration 'std::vector<int> G [100000]'
   10 | vector<int> G[MAX];
      |             ^
a.cc:8:5: note: previous declaration as 'int G [100000][100000]'
    8 | int G[MAX][MAX];
      |     ^
a.cc: In function 'void dfs(int, int)':
a.cc:14:3: error: 'stack' was not declared in this scope
   14 |   stack<int> S;
      |   ^~~~~
a.cc:3:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    2 | #include<vector>
  +++ |+#include <stack>
    3 | #inlcude<stack>
a.cc:14:9: error: expected primary-expression before 'int'
   14 |   stack<int> S;
      |         ^~~
a.cc:16:3: error: 'S' was not declared in this scope
   16 |   S.push(r);
      |   ^
a.cc:21:22: error: request for member 'size' in 'G[u]', which is of non-class type 'int [100000]'
   21 |     for (i=0; i<G[u].size(); i++) {
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:55:10: error: request for member 'push_back' in 'G[s]', which is of non-class type 'int [100000]'
   55 |     G[s].push_back(t);
      |          ^~~~~~~~~
a.cc:56:10: error: request for member 'push_back' in 'G[t]', which is of non-class type 'int [100000]'
   56 |     G[t].push_back(s);
      |          ^~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1

int n, color[MAX];
vector<int> G[MAX];


void dfs(int r, int c) {
  stack<int> S;
  int i, v, u;
  S.push(r);
  color[r]=c;
  while (! S.empty()) {
    u=S.top();
    S.pop();
    for (i=0; i<G[u].size(); i++) {
        v=G[u][i];
      if (color[v]==NIL) {
        color[v]=c;
        S.push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  cin >> n >> m;

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

  cin >> q;

  for (i=0; i<q; i++) {
    cin >> s >> t;
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude<stack>
      |  ^~~~~~~
      |  include
a.cc: In function 'void dfs(int, int)':
a.cc:13:3: error: 'stack' was not declared in this scope
   13 |   stack<int> S;
      |   ^~~~~
a.cc:3:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    2 | #include<vector>
  +++ |+#include <stack>
    3 | #inlcude<stack>
a.cc:13:9: error: expected primary-expression before 'int'
   13 |   stack<int> S;
      |         ^~~
a.cc:15:3: error: 'S' was not declared in this scope
   15 |   S.push(r);
      |   ^
Language: C++

#include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1

int n, color[MAX];
vector<int> G[MAX];


void dfs(int r, int c) {
  stack<int> S;
  int i, v, u;
  S.push(r);
  color[r]=c;
  while (! S.empty()) {
    u=S.top();
    S.pop();
    for (i=0; i<G[u].size(); i++) {
        v=G[u][i];
      if (color[v]==NIL) {
        color[v]=c;
        S.push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  cin >> n >> m;

  for (i=0; i<m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

  cin >> q;

  for (i=0; i<q; i++) {
    cin >> s >> t;
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude<stack>
      |  ^~~~~~~
      |  include
a.cc: In function 'void dfs(int, int)':
a.cc:13:3: error: 'stack' was not declared in this scope
   13 |   stack<int> S;
      |   ^~~~~
a.cc:3:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    2 | #include<vector>
  +++ |+#include <stack>
    3 | #inlcude<stack>
a.cc:13:9: error: expected primary-expression before 'int'
   13 |   stack<int> S;
      |         ^~~
a.cc:15:3: error: 'S' was not declared in this scope
   15 |   S.push(r);
      |   ^
Language: C++

#include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1

int n;
vector<int> G[MAX];
int color[MAX];


void dfs(int r, int c) {
  stack<int> S;
  int i, v, u;
  S.push(r);
  color[r]=c;
  while (! S.empty()) {
    u=S.top();
    S.pop();
    for (i=0; i<G[u].size(); i++) {
        v=G[u][i];
      if (color[v]==NIL) {
        color[v]=c;
        S.push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  cin >> n >> m;

  for (i=0; i<m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

  cin >> q;

  for (i=0; i<q; i++) {
    cin >> s >> t;
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude<stack>
      |  ^~~~~~~
      |  include
a.cc: In function 'void dfs(int, int)':
a.cc:14:3: error: 'stack' was not declared in this scope
   14 |   stack<int> S;
      |   ^~~~~
a.cc:3:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    2 | #include<vector>
  +++ |+#include <stack>
    3 | #inlcude<stack>
a.cc:14:9: error: expected primary-expression before 'int'
   14 |   stack<int> S;
      |         ^~~
a.cc:16:3: error: 'S' was not declared in this scope
   16 |   S.push(r);
      |   ^
Language: C++

#include <cassert>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <list>

class TVertex
{
    int FIndex;
    int FCommuniyId;
    std::list<TVertex*> FList;

public:
    TVertex(int Index)
     : FIndex(Index), FCommuniyId(0)
    {}
    void AddPath(TVertex* Vertex)
    {
        FList.push_back(Vertex);
    }
    void SetCommunity(int CommunityId)
    {
        if(FCommuniyId) return;
        FCommuniyId = CommunityId;
        for(std::list<TVertex*>::iterator It = FList.begin(); It != FList.end(); ++It){
            TVertex* V = *It;
            V->SetCommunity(CommunityId);
        }
    }
    int CommunityId()const
    {
        return FCommuniyId;
    }
};
class TGraph
{
    std::vector<TVertex*> FTable;
    void Init(int n)
    {
        assert(n > 0);
        FTable.resize(n);
        for(int i = 0; i < n; ++i){
            FTable[i] = new TVertex(i);
        }
    }
public:
    TGraph(int n)
    {
        Init(n);
    }
    void MakeFriend(int s, int t)
    {
        assert(s < FTable.size());
        assert(t < FTable.size());
        FTable[s]->AddPath(FTable[t]);
        FTable[t]->AddPath(FTable[s]);
    }
    void SetCommunity()
    {
        for(std::size_t i = 0; i < FTable.size(); ++i){
            FTable[i]->SetCommunity(i+1);
        }
    }
    bool IsSameCommunity(int s, int t)const
    {
        assert(s < FTable.size());
        assert(t < FTable.size());
        return FTable[s]->CommunityId() == FTable[t]->CommunityId();
    }
};

int main()
{
    int n, m;
    std::scanf("%d %d", &n, &m);
    TGraph Graph(n);
    for(int i = 0; i < m; ++i){
        int s, t;
        std::scanf("%d %d", &s, &t);
        Graph.MakeFriend(s, t);
    }
    int q;
    std::scanf("%d", &q)
    Graph.SetCommunity();
    for(int i = 0; i < q; ++i){
        int s, t;
        std::scanf("%d %d", &s, &t);
        std::printf("%s\n", (Graph.IsSameCommunity(s, t) ? "yes" : "no"));
    }
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:25: error: expected ';' before 'Graph'
   84 |     std::scanf("%d", &q)
      |                         ^
      |                         ;
   85 |     Graph.SetCommunity();
      |     ~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];


void dfs(int r, int c) {
	stack<int> S;
	S.push(r);
	color[r] = c;
	while (!S.empty()) {
		int u = S.top(); S.pop();
		for (int i = 0; i < G[u].size(); i++) {
			int v = G[u][i];
			if (color[v] == NIL) {
				color[v] = c;
				S.push(v);
			}
		}
	}
}

void assignColor() {
	int id = 1;
	for (int i = 0; i < n; i++)color[i] = NIL;
	for (int u = 0; u < n; u++) {
		if (color[u] == NIL)dfs(u, id++);
	}
}

int main()
{
	int s, t, m, q;
    
	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		cin >> s >> t;
		G.push_back(t);
		G.push_back(s);
	}

	assignColor();

	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> s >> t;
		if (color[s] == color[t]) {
			cout << "yes" << endl;
		}else {
			cout << "no" << endl;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:19: error: request for member 'push_back' in 'G', which is of non-class type 'std::vector<int> [100000]'
   44 |                 G.push_back(t);
      |                   ^~~~~~~~~
a.cc:45:19: error: request for member 'push_back' in 'G', which is of non-class type 'std::vector<int> [100000]'
   45 |                 G.push_back(s);
      |                   ^~~~~~~~~
Language: C++

#include<cstdio>
#include<stack>
#include<vector>
using namespace std;
const int big=100000;
const int nil=-1;
int n;
vector<int> tu[big];
int color[big];
void dfs(int r,int c)
{
    stack<int>a;
    a.push(r);
    color[r]=c;
    while(!a.empty())
    {
        int u=a.top();
        a.pop();
        for (int i=0;i<tu[u].size();i++)
        {
            int v=tu[u][i];
            if(color[v]==nil)
            {
                color[v]=c;
                a.push(v);
            }
        }
    }
}
void yanse()
{
    int id=1;
    for (int i=0;i<n;i++)
        color[i]=nil;
    for (int u=0;u<n;u++)
    {
        if(color[u]==nil)
            dfs(u,id++);
    }
}
int mian()
{
    int s,t,m,q;
    scanf("%d%d",&m,&n);
    for (int i=0;i<m;i++)
    {
        scanf("%d%d",&n,&m);
        tu[s].push_back(t);
        tu[t].push_back(s);
    }
    yanse();
    scanf("%d",&q);
    for (int i=0;i<q;i++)
    {
        scanf("%d%d",&s,&t);
        if(color[s]==color[t])
        {
            printf("yes\n");
        }
        else
        {
            printf("no\n");
        }
    }
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define N_MAX 100000

int search_connection(int s, int t);
vector<int> G[N_MAX], check_v;

int main()
{
    int n, m, i, s, t, q;

    cin >> n >> m;

    //??£??\??????????????????
    for (i = 0; i < m; i++) {
        cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }

    //??????????????????
    cin >> q;
    for (i = 0; i < q; i++) {
//        cout << "Q. " << i << endl;

        cin >> s >> t;

        if (check_v.size() != 0) check_v.clear();

        check_v.push_back(s);
        if ( search_connection(s, t) )
            cout << "yes" << endl;
        else
            cout << "no" << endl;
    }

    return 0;
}

int search_connection(int s, int t) {
    int i;
//    cout << "search " << s << ", " << t << endl;

    for (auto itr = G[s].begin(); itr != G[s].end(); itr++) {
        if (*itr == t) {
            return 1;
        }
        else if ( find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
            //*itr?????¢?????¢?´¢??????node?????´??????????????¢?´¢????????????
        }
        else {
            //*itr???????????¢?´¢???????????????node?????´???
            check_v.push_back(*itr);
            if ( search_connection(*itr, t) )
                return 1;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int search_connection(int, int)':
a.cc:51:23: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   51 |         else if ( find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:51:23: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   51 |         else if ( find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define N_MAX 100000

int search_connection(int s, int t);
vector<int> G[N_MAX], check_v;

int main()
{
    int n, m, i, s, t, q;

    cin >> n >> m;

    //??£??\??????????????????
    for (i = 0; i < m; i++) {
        cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }

    //??????????????????
    cin >> q;
    for (i = 0; i < q; i++) {
//        cout << "Q. " << i << endl;

        cin >> s >> t;

        if (check_v.size() != 0) check_v.clear();

        check_v.push_back(s);
        if ( search_connection(s, t) )
            cout << "yes" << endl;
        else
            cout << "no" << endl;
    }

    return 0;
}

int search_connection(int s, int t) {
    int i;
//    cout << "search " << s << ", " << t << endl;

    for (auto itr = G[s].begin(); itr != G[s].end(); itr++) {
        if (*itr == t) {
            return 1;
        }
        else if ( std::find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
            //*itr?????¢?????¢?´¢??????node?????´??????????????¢?´¢????????????
        }
        else {
            //*itr???????????¢?´¢???????????????node?????´???
            check_v.push_back(*itr);
            if ( search_connection(*itr, t) )
                return 1;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int search_connection(int, int)':
a.cc:51:28: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   51 |         else if ( std::find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
      |                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:51:28: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   51 |         else if ( std::find(check_v.begin(), check_v.end(), *itr) != check_v.end() ) {
      |                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<list>
#include<iterator>
using namespace std;

class person
{
public:
	int id;
	bool Isdone = false;
	list <person*> lis;
	bool serch(person* Per)
	{
		Isdone = true;
		for(list<person*>::iterator temp=lis.begin();temp!=lis.end();++temp)
		{
			if ((*temp) == Per)return true;
			else if ((*temp)->Isdone == true)continue;
			else
			{
				if ((*temp)->serch(Per))return true;
			}
		}
		return false;
	}
};

person P[100001];

int main()
{
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++)P[i].id = i;
	for (int i = 0; i < m; i++)
	{
		int p1, p2;
		scanf_s("%d%d",&p1, &p2);
		P[p1].lis.push_back(&P[p2]);
		P[p2].lis.push_back(&P[p1]);
	}			 
	int q;
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int p1, p2;
		scanf_s("%d%d", &p1, &p2);
		if (P[p1].serch(&P[p2]))
		{
			cout << "yes" << endl;
		}
		else
		{
			cout << "no" << endl;
		}
		for (int l = 0; l < n; l++)P[l].Isdone = false;
	}
	return 0;
}

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

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}

signed main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	puts("yes");
      else
	puts("no");
    }  
  
  return 0;
}

Compiler output:
/tmp/ccUKiIOE.o: in function `dfs(int, int)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccUKiIOE.o
a.cc:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccUKiIOE.o
a.cc:(.text+0xb7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccUKiIOE.o
/tmp/ccUKiIOE.o: in function `main':
a.cc:(.text+0xd7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccUKiIOE.o
a.cc:(.text+0xf3): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccUKiIOE.o
a.cc:(.text+0x192): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccUKiIOE.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
signed main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	cout<<"yes"<<endl;
      else
	cout<<"no"<<endl;
    }    
  return 0;
}

Compiler output:
/tmp/cc3QZAq5.o: in function `dfs(int, int)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc3QZAq5.o
a.cc:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc3QZAq5.o
a.cc:(.text+0xb7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc3QZAq5.o
/tmp/cc3QZAq5.o: in function `main':
a.cc:(.text+0xd7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc3QZAq5.o
a.cc:(.text+0xf3): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc3QZAq5.o
a.cc:(.text+0x192): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc3QZAq5.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;
/*
void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}
*/
int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
signed main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	cout<<"yes"<<endl;
      else
	cout<<"no"<<endl;
    }    
  return 0;
}

Compiler output:
/tmp/cctnb7gj.o: in function `dfs(int, int)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cctnb7gj.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cctnb7gj.o
a.cc:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cctnb7gj.o
/tmp/cctnb7gj.o: in function `main':
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cctnb7gj.o
a.cc:(.text+0xec): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cctnb7gj.o
a.cc:(.text+0x18b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cctnb7gj.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;
/*
void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}
*/
int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
signed main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	cout<<"yes"<<endl;
      else
	cout<<"no"<<endl;
    }    
  return 0;
}

Compiler output:
/tmp/cc487yNC.o: in function `dfs(int, int)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc487yNC.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc487yNC.o
a.cc:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc487yNC.o
/tmp/cc487yNC.o: in function `main':
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc487yNC.o
a.cc:(.text+0xec): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc487yNC.o
a.cc:(.text+0x18b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc487yNC.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;
/*
void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}
*/
int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
signed main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	cout<<"yes"<<endl;
      else
	cout<<"no"<<endl;
    }    
  return 0;
}

Compiler output:
/tmp/ccXQR3Qd.o: in function `dfs(int, int)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccXQR3Qd.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccXQR3Qd.o
a.cc:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccXQR3Qd.o
/tmp/ccXQR3Qd.o: in function `main':
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccXQR3Qd.o
a.cc:(.text+0xec): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXQR3Qd.o
a.cc:(.text+0x18b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXQR3Qd.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

#ifdef DEBUG
#define dprintf      printf
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)    {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for((i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(1){}else
#define drep(i,n)    if(1){}else
#define dstop()      if(1){}else
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__);
#define array(T,id,n) T id[n]; rep(i,n)cin>>id[i];

//#define int long long;
#ifndef int
#define INF  (0x7fffffff)
#else
#define LINF (0x7fffffffffffffff)
#endif

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;
/*
void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}
*/
int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  dout(v);
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  cin>>n>>m;
  rep(i,m)
    {
      cin>>a>>b;
      e[a][b]=1;
      e[b][a]=1;
    }
  cin>>q;
  rep(i,q)
    {
      cin>>s>>t;
      if(dfs(s,t))
	cout<<"yes"<<endl;
      else
	cout<<"no"<<endl;
    }    
  return 0;
}

Compiler output:
/tmp/cc5Rt28H.o: in function `dfs(int, int)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc5Rt28H.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/cc5Rt28H.o
a.cc:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc5Rt28H.o
/tmp/cc5Rt28H.o: in function `main':
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc5Rt28H.o
a.cc:(.text+0xec): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc5Rt28H.o
a.cc:(.text+0x18b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc5Rt28H.o
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
#include<queue>

using namespace std;

const int MAX = 100000;

int parent(int table[], int child) {

	while (table[child] != -1) {
		q.push(child);
		child = table[child];
	}
	return child;
}

int main() {
	int n, m, q;
	int table[MAX];

	scanf("%d %d", &n, &m);

	for (int i = 0; i < n; i++)table[i] = -1;
	for (int i = 0; i < m; i++) {
		int s, t;
		scanf("%d %d", &s, &t);
		
		int ps = parent(table, s);
		int pt = parent(table, t);
		if (ps != pt) {
			table[ps] = pt;
		}
	}

	scanf("%d", &q);

	for (int i = 0; i < q; i++) {
		int s, t;
		
		scanf("%d %d", &s, &t);

		int ps = parent(table, s);
		int pt = parent(table, t);

		if (ps == pt) {
			printf("yes\n");
		}
		else {
			printf("no\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int parent(int*, int)':
a.cc:11:17: error: 'q' was not declared in this scope
   11 |                 q.push(child);
      |                 ^
Language: C++

#include<stdio.h>
using namespace std;

const int MAX = 100000;

int parent(int table[], int child) {
	while (table[child] != -1) {
		q.push(child);
		child = table[child];
	}
	return child;
}

int main() {
	int n, m, q;
	int table[MAX];

	scanf("%d %d", &n, &m);

	for (int i = 0; i < n; i++)table[i] = -1;
	for (int i = 0; i < m; i++) {
		int s, t;
		scanf("%d %d", &s, &t);
		
		int ps = parent(table, s);
		int pt = parent(table, t);
		if (ps != pt) {
			table[ps] = pt;
		}
	}

	scanf("%d", &q);

	for (int i = 0; i < q; i++) {
		int s, t;
		
		scanf("%d %d", &s, &t);

		int ps = parent(table, s);
		int pt = parent(table, t);

		if (ps == pt) {
			printf("yes\n");
		}
		else {
			printf("no\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int parent(int*, int)':
a.cc:8:17: error: 'q' was not declared in this scope
    8 |                 q.push(child);
      |                 ^
Language: C++

#include <cstdint>
#include <vector>

using namespace std;

#define GRAPH_SIZE 100000

enum state_t {
  WHITE,
  GRAY,
  BLACK,
};

struct vertex_t {
  uint32_t color;
  vector<uint32_t> connections;
};

static vertex_t graph[GRAPH_SIZE];
static state_t state[GRAPH_SIZE];

static void colorize(uint32_t index, uint32_t color)
{
  if (state[index] == WHITE) {
    state[index] = GRAY;
    graph[index].color = color;
    for (uint32_t i = 0; i < graph[index].connections.size(); i++) {
      colorize(graph[index].connections[i], color);
    }
    state[index] = BLACK;
  }
}

void check_connection(size_t num)
{
  for (uint32_t i = 0; i < num; i++) {
    state[i] = WHITE;
  }

  uint32_t color = 1;
  for (uint32_t i = 0; i < knum; i++) {
    colorize(i, color);
    color++;
  }
}

#include <iostream>

int32_t main()
{
  uint32_t n, m;
  cin >> n >> m;

  for (uint32_t i = 0; i < m; i++) {
    uint32_t index, to;
    cin >> index >> to;
    graph[index].connections.push_back(to);
  }

  check_connection(n);

  uint32_t qs;
  cin >> qs;

  for (uint32_t i = 0; i < qs; i++) {
    uint32_t from, to;
    cin >> from >> to;

    if (graph[from].color == graph[to].color) {
      cout << "yes" << endl;
    } else {
      cout << "no" << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'void check_connection(size_t)':
a.cc:41:28: error: 'knum' was not declared in this scope; did you mean 'num'?
   41 |   for (uint32_t i = 0; i < knum; i++) {
      |                            ^~~~
      |                            num
Language: C++

#include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;

int n;

vector<int> G[MAX];
int color[MAX];



void dfs(int r,int c){
  
stack<int>.S;
  S.push(r);
  color[r]=c;
  while(!S.empty()){
    int u = S.pop();
    for(int i=0;i<G[u].size();i++){
      int v = G[u][i];

      if(color[v]==NIL){
	color[v]=c;
	S.push(v);
      }
    }
  }
}

void assignColor(){
  int i,u,id=1;
  for(i=0;i<n;i++) color[i] = NIL;
  for(u=0;u<n;u++){
    if(color[u]==NIL) bfs(u,id++);
  }
}

int main(){
  int i,s,t,m,q;
 cin >> n >> m;
  for(i=0;i<m;i++){
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

cin >> q;
  for(i=0;i<q;i++){
    cin >> s >> t;
    if(color[s]==color[t]){
 cout << ?¨yes?¨ <<endl;
    }
    else cout << ?¨no?¨ <<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:11: error: expected unqualified-id before '.' token
   17 | stack<int>.S;
      |           ^
a.cc:18:3: error: 'S' was not declared in this scope
   18 |   S.push(r);
      |   ^
a.cc: In function 'void assignColor()':
a.cc:37:23: error: 'bfs' was not declared in this scope; did you mean 'dfs'?
   37 |     if(color[u]==NIL) bfs(u,id++);
      |                       ^~~
      |                       dfs
a.cc: In function 'int main()':
a.cc:56:10: error: expected primary-expression before '?' token
   56 |  cout << ?¨yes?¨ <<endl;
      |          ^
a.cc:56:11: error: '\U000000a8yes' was not declared in this scope
   56 |  cout << ?¨yes?¨ <<endl;
      |           ^~~~
a.cc:56:16: error: '\U000000a8' was not declared in this scope
   56 |  cout << ?¨yes?¨ <<endl;
      |                ^
a.cc:56:24: error: expected ':' before ';' token
   56 |  cout << ?¨yes?¨ <<endl;
      |                        ^
      |                        :
a.cc:56:24: error: expected primary-expression before ';' token
a.cc:56:24: error: expected ':' before ';' token
   56 |  cout << ?¨yes?¨ <<endl;
      |                        ^
      |                        :
a.cc:56:24: error: expected primary-expression before ';' token
a.cc:58:18: error: expected primary-expression before '?' token
   58 |     else cout << ?¨no?¨ <<endl;
      |                  ^
a.cc:58:19: error: '\U000000a8no' was not declared in this scope
   58 |     else cout << ?¨no?¨ <<endl;
      |                   ^~~
a.cc:58:23: error: '\U000000a8' was not declared in this scope
   58 |     else cout << ?¨no?¨ <<endl;
      |                       ^
a.cc:58:31: error: expected ':' before ';' token
   58 |     else cout << ?¨no?¨ <<endl;
      |                               ^
      |                               :
a.cc:58:31: error: expected primary-expression before ';' token
a.cc:58:31: error: expected ':' before ';' token
   58 |     else cout << ?¨no?¨ <<endl;
      |                               ^
      |                               :
a.cc:58:31: error: expected primary-expression before ';' token
Language: C++

#include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;

int n;

vector<int> G[MAX];
int color[MAX];



void dfs(int r,int c){
  
stack<int>.S;
  S.push(r);
  color[r]=c;
  while(!S.empty()){
    int u = S.pop();
    for(int i=0;i<G[u].size();i++){
      int v = G[u][i];

      if(color[v]==NIL){
	color[v]=c;
	S.push(v);
      }
    }
  }
}

void assignColor(){
  int i,u,id=1;
  for(i=0;i<n;i++) color[i] = NIL;
  for(u=0;u<n;u++){
    if(color[u]==NIL) bfs(u,id++);
  }
}

int main(){
  int i,s,t,m,q;
 cin >> n >> m;
  for(i=0;i<m;i++){
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

cin >> q;
  for(i=0;i<q;i++){
    cin >> s >> t;
    if(color[s]==color[t]){
 cout << ?¨yes?¨ <<endl;
    }
    else {
cout << ?¨no?¨ <<endl;
}
  }
  return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:11: error: expected unqualified-id before '.' token
   17 | stack<int>.S;
      |           ^
a.cc:18:3: error: 'S' was not declared in this scope
   18 |   S.push(r);
      |   ^
a.cc: In function 'void assignColor()':
a.cc:37:23: error: 'bfs' was not declared in this scope; did you mean 'dfs'?
   37 |     if(color[u]==NIL) bfs(u,id++);
      |                       ^~~
      |                       dfs
a.cc: In function 'int main()':
a.cc:56:10: error: expected primary-expression before '?' token
   56 |  cout << ?¨yes?¨ <<endl;
      |          ^
a.cc:56:11: error: '\U000000a8yes' was not declared in this scope
   56 |  cout << ?¨yes?¨ <<endl;
      |           ^~~~
a.cc:56:16: error: '\U000000a8' was not declared in this scope
   56 |  cout << ?¨yes?¨ <<endl;
      |                ^
a.cc:56:24: error: expected ':' before ';' token
   56 |  cout << ?¨yes?¨ <<endl;
      |                        ^
      |                        :
a.cc:56:24: error: expected primary-expression before ';' token
a.cc:56:24: error: expected ':' before ';' token
   56 |  cout << ?¨yes?¨ <<endl;
      |                        ^
      |                        :
a.cc:56:24: error: expected primary-expression before ';' token
a.cc:59:9: error: expected primary-expression before '?' token
   59 | cout << ?¨no?¨ <<endl;
      |         ^
a.cc:59:10: error: '\U000000a8no' was not declared in this scope
   59 | cout << ?¨no?¨ <<endl;
      |          ^~~
a.cc:59:14: error: '\U000000a8' was not declared in this scope
   59 | cout << ?¨no?¨ <<endl;
      |              ^
a.cc:59:22: error: expected ':' before ';' token
   59 | cout << ?¨no?¨ <<endl;
      |                      ^
      |                      :
a.cc:59:22: error: expected primary-expression before ';' token
a.cc:59:22: error: expected ':' before ';' token
   59 | cout << ?¨no?¨ <<endl;
      |                      ^
      |                      :
a.cc:59:22: error: expected primary-expression before ';' token
Language: C++

#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#define white 0
#define grey 1
#define nil -1
#define maxn 100000
using namespace std;

vector<int> g[maxn+5];
int color[maxn+5];
int n,m;

void dfs(int s,int t)
{
    stack<int>q;
    q.push(s);
    color[r]=t;
    while(!q.empty())
    {
        int v=q.top();
        q.pop();
        for(int j=0;j<g[v].size();j++)
        {
            int u=g[v][j];
            if(color[u]==nil)
            {
                q.push(u);
                color[u]=t;
            }
        }
    }
}

void work()
{
    int id=1;
    for(int i=0;i<n;i++)
        color[i]=nil;
    for(int i=0;i<n;i++)
        if(color[i]==nil)
           dfs(i,id++);
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
        g[x].push_back(y);
        g[y].push_back(x);
    }
    work();

    int q;
    scanf("%d",&q);
    for(int i=1;i<=q;i++)
    {
        int s,t;
        scanf("%d%d",&s,&t);
        if(color[s]==color[t])
            printf("yes\n");
        else printf("no\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:22:11: error: 'r' was not declared in this scope
   22 |     color[r]=t;
      |           ^