Language: C++

#include <bits/stdc++.h>

using namespace std;

#define lp(i,n) for(int i = 0; i <n;i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define MP make_pair
#define SZ(v) ((int)((v).size()))
typedef long long ll;

const ll MOD = 1e9 + 7;
const int OO = (int)1e6;
const int N = (int)2e5;

void init(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int n;
bool vis[N];
int col[N];
vector<vector<pair<int,int>>>adj;
void dfs(int parent ,int cur,int color){
    if(vis[cur])return;
    vis[cur]=1;
    col[cur]=color;
    for(int i=0;i<adj[cur].size();i++){
        auto node = adj[cur][i];
        if(node.first==parent)continue;
        dfs(cur,node.first,color^node.second);
    }
}
int main() {
	#   ifdef LOCAL_PROJECT
        freopen("in.txt", "r", stdin);
    #   endif
    scanf("%d",&n);
    adj=vector<vector<pair<int,int>>>(n);
    for(int i=0;i<n;i++){
        int from,to,w;
        scanf("%d%d%d",&from,&to,&w);
        from--;
        to--;
        adj[from].push_back({to,w%2});
        adj[to].push_back({from,w%2});
    }
    dfs(-1,0,0);
    for(int i=0;i<n;i++){
        printf("%d\n",col[i]);
    }
    return 0;
}#include <bits/stdc++.h>

using namespace std;

#define lp(i,n) for(int i = 0; i <n;i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define MP make_pair
#define SZ(v) ((int)((v).size()))
typedef long long ll;

const ll MOD = 1e9 + 7;
const int OO = (int)1e6;
const int N = (int)1e7;

void init(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int n;
bool vis[N];
int col[N];
vector<vector<pair<int,int>>>adj;
void dfs(int parent ,int cur,int color){
    if(vis[cur])return;
    vis[cur]=1;
    col[cur]=color;
    for(int i=0;i<adj[cur].size();i++){
        auto node = adj[cur][i];
        if(node.first==parent)continue;
        dfs(cur,node.first,color^node.second);
    }
}
int main() {
	#   ifdef LOCAL_PROJECT
        freopen("in.txt", "r", stdin);
    #   endif
    scanf("%d",&n);
    adj=vector<vector<pair<int,int>>>(n);
    for(int i=0;i<n;i++){
        int from,to,w;
        scanf("%d%d%d",&from,&to,&w);
        from--;
        to--;
        adj[from].push_back({to,w%2});
        adj[to].push_back({from,w%2});
    }
    dfs(-1,0,0);
    for(int i=0;i<n;i++){
        printf("%d\n",col[i]);
    }
    return 0;
}

Compiler output:
a.cc:54:2: error: stray '#' in program
   54 | }#include <bits/stdc++.h>
      |  ^
a.cc:54:3: error: 'include' does not name a type
   54 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:65:10: error: redefinition of 'const ll MOD'
   65 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:12:10: note: 'const ll MOD' previously defined here
   12 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:66:11: error: redefinition of 'const int OO'
   66 | const int OO = (int)1e6;
      |           ^~
a.cc:13:11: note: 'const int OO' previously defined here
   13 | const int OO = (int)1e6;
      |           ^~
a.cc:67:11: error: redefinition of 'const int N'
   67 | const int N = (int)1e7;
      |           ^
a.cc:14:11: note: 'const int N' previously defined here
   14 | const int N = (int)2e5;
      |           ^
a.cc:69:6: error: redefinition of 'void init()'
   69 | void init(){
      |      ^~~~
a.cc:16:6: note: 'void init()' previously defined here
   16 | void init(){
      |      ^~~~
a.cc:74:5: error: redefinition of 'int n'
   74 | int n;
      |     ^
a.cc:21:5: note: 'int n' previously declared here
   21 | int n;
      |     ^
a.cc:75:6: error: redefinition of 'bool vis [200000]'
   75 | bool vis[N];
      |      ^~~
a.cc:22:6: note: 'bool vis [200000]' previously declared here
   22 | bool vis[N];
      |      ^~~
a.cc:76:5: error: redefinition of 'int col [200000]'
   76 | int col[N];
      |     ^~~
a.cc:23:5: note: 'int col [200000]' previously declared here
   23 | int col[N];
      |     ^~~
a.cc:77:30: error: redefinition of 'std::vector<std::vector<std::pair<int, int> > > adj'
   77 | vector<vector<pair<int,int>>>adj;
      |                              ^~~
a.cc:24:30: note: 'std::vector<std::vector<std::pair<int, int> > > adj' previously declared here
   24 | vector<vector<pair<int,int>>>adj;
      |                              ^~~
a.cc:78:6: error: redefinition of 'void dfs(int, int, int)'
   78 | void dfs(int parent ,int cur,int color){
      |      ^~~
a.cc:25:6: note: 'void dfs(int, int, int)' previously defined here
   25 | void dfs(int parent ,int cur,int color){
      |      ^~~
a.cc:88:5: error: redefinition of 'int main()'
   88 | int main() {
      |     ^~~~
a.cc:35:5: note: 'int main()' previously defined here
   35 | int main() {
      |     ^~~~