Language: C++

#include <bits/stdc++.h>
using namespace std;
void dfs( vector<vector<vector<int>>> &G, vector<int> &co,int v,vector<long long> &ee){
  if(G[v].size()==0)
  for(auto s:G[v]){
    if(co[v]!=-1) continue;
    ee[s[0]]=ee[v];
    ee[s[0]]+=s[1];
    if(ee[s[0]]%2==0) co[s[0]]=0;
    else co[s[0]]=1;
    dfs(G,co,s[0],ee);
  }
}
    

int main() {
  int n;
  cin>>n;
  vector<long long> ee(n);
  vector<int> co(n,-1);
  co[0]=0;
  vector<vector<vector<int>>> G(n,vector<vector<int>> (1,vector<int> (1)));
  for(int i=0;i<n-1;i++){
    int a,s,d;
    cin>>a>>s>>d;
    vector<vector<int>> dd(1);
      dd={{s-1,d}};
    vector<vector<int>> ad(1);
      ad={{a-1,d}};
    G[a-1].push_back(dd);
    G[s-1].push_back(ad);
  }
  dfs(G,co,0,ee);
  for(int i=0;i<n;i++){
    cout<<co[i]<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(std::vector<std::vector<int> >&)'
   30 |     G[a-1].push_back(dd);
      |     ~~~~~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:31:21: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(std::vector<std::vector<int> >&)'
   31 |     G[s-1].push_back(ad);
      |     ~~~~~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<std::vector<int> >' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~