Language: C++

x#include <bits/stdc++.h>
typedef long long ll;
#define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
#define digit(a) to_string(a).size()
#define INF 10e12
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
using namespace std;
int main(void)

{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> v(n);
    vector<int> dis(n, (int)INF), prev(n);
    rep(i, 0, m)
    {
        int a, b;
        cin >> a >> b;
        --a, --b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    priority_queue<int> q;
    q.push(0);
    dis[0] = 0;
    ll cta = 1;
    while (!q.empty())
    {
        int temp = q.top();
        q.pop();
        for (auto i : v[temp])
        {
            if (dis[i] >= dis[temp] + 1)
                dis[i] = dis[temp] + 1, q.push(i), prev[i] = temp, ++cta;
        }
    }
    if (cta < n)
        cout << "No" << endl;
    else
    {
        cout << "Yes" << endl;
        rep(i, 1, n) printf("%d\n", prev[i] + 1);
    }
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | x#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'x' does not name a type
    1 | x#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:14:5: error: 'cin' was not declared in this scope
   14 |     cin.tie(0);
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | x#include <bits/stdc++.h>
a.cc:15:5: error: 'ios' has not been declared
   15 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:18:5: error: 'vector' was not declared in this scope
   18 |     vector<vector<int>> v(n);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | x#include <bits/stdc++.h>
a.cc:18:19: error: expected primary-expression before 'int'
   18 |     vector<vector<int>> v(n);
      |                   ^~~
a.cc:19:12: error: expected primary-expression before 'int'
   19 |     vector<int> dis(n, (int)INF), prev(n);
      |            ^~~
a.cc:3:27: error: 'll' was not declared in this scope; did you mean 'all'?
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                           ^~
a.cc:20:5: note: in expansion of macro 'rep'
   20 |     rep(i, 0, m)
      |     ^~~
a.cc:20:9: error: 'i' was not declared in this scope
   20 |     rep(i, 0, m)
      |         ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                                     ^
a.cc:20:15: error: expected ';' before 'm'
   20 |     rep(i, 0, m)
      |               ^
a.cc:3:45: note: in definition of macro 'rep'
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                                             ^
a.cc:3:46: error: expected ')' before ';' token
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                          ~                   ^
a.cc:20:5: note: in expansion of macro 'rep'
   20 |     rep(i, 0, m)
      |     ^~~
a.cc:20:9: error: 'i' was not declared in this scope
   20 |     rep(i, 0, m)
      |         ^
a.cc:3:50: note: in definition of macro 'rep'
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                                                  ^
a.cc:28:5: error: 'priority_queue' was not declared in this scope
   28 |     priority_queue<int> q;
      |     ^~~~~~~~~~~~~~
a.cc:1:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | x#include <bits/stdc++.h>
a.cc:28:20: error: expected primary-expression before 'int'
   28 |     priority_queue<int> q;
      |                    ^~~
a.cc:29:5: error: 'q' was not declared in this scope
   29 |     q.push(0);
      |     ^
a.cc:30:5: error: 'dis' was not declared in this scope
   30 |     dis[0] = 0;
      |     ^~~
a.cc:31:5: error: 'll' was not declared in this scope; did you mean 'all'?
   31 |     ll cta = 1;
      |     ^~
      |     all
a.cc:36:23: error: 'v' was not declared in this scope
   36 |         for (auto i : v[temp])
      |                       ^
a.cc:39:52: error: 'prev' was not declared in this scope
   39 |                 dis[i] = dis[temp] + 1, q.push(i), prev[i] = temp, ++cta;
      |                                                    ^~~~
a.cc:1:1: note: 'std::prev' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
  +++ |+#include <iterator>
    1 | x#include <bits/stdc++.h>
a.cc:39:70: error: 'cta' was not declared in this scope
   39 |                 dis[i] = dis[temp] + 1, q.push(i), prev[i] = temp, ++cta;
      |                                                                      ^~~
a.cc:42:9: error: 'cta' was not declared in this scope
   42 |     if (cta < n)
      |         ^~~
a.cc:43:9: error: 'cout' was not declared in this scope
   43 |         cout << "No" << endl;
      |         ^~~~
a.cc:43:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:25: error: 'endl' was not declared in this scope
   43 |         cout << "No" << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | x#include <bits/stdc++.h>
a.cc:46:9: error: 'cout' was not declared in this scope
   46 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:46:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:46:26: error: 'endl' was not declared in this scope
   46 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:46:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:47:13: error: expected ';' before 'i'
   47 |         rep(i, 1, n) printf("%d\n", prev[i] + 1);
      |             ^
a.cc:3:30: note: in definition of macro 'rep'
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                              ^
a.cc:47:19: error: expected ';' before 'n'
   47 |         rep(i, 1, n) printf("%d\n", prev[i] + 1);
      |                   ^
a.cc:3:45: note: in definition of macro 'rep'
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                                             ^
a.cc:3:46: error: expected ')' before ';' token
    3 | #define rep(i, a, b) for (ll i = a; i < (ll)b; ++i)
      |                          ~                   ^
a.cc:47:9: note: in expansion of macro 'rep'
   47 |         rep(i, 1, n) printf("%d\n", prev[i] + 1);
      |         ^~~