Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r) for(long long i = l; i < r; i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second

#define V_MAX 1e5 + 1
vector<map<ll, pair<ll, ll>>> G[V_MAX];
vector<ll> color(V_MAX,0);

bool is_bipartite(ll v, ll c){
    color[v] = c;
    rep(i, 0, G[v].size()){
        if(color[G[v][i].fi] == c) return false;
        if(color[G[v][i].se] == 0 && !is_bipartite(G[v][i].fi, -c)) return false;
    }
    return true;
}

int main(){
    ll n; cin >> n;
    
    rep(i,0,n){
        ll u, v, w;
        cin >> u >> v >> w;
        G[u].pb(mp(v,w));
        G[v].pb(mp(u,w));
    }

    if(is_bipartite(0, 1)){
        rep(i,0,n) cout << color[i] << endl;
    }else{
        cout << "-1" << endl;
    }

}


Compiler output:
a.cc:10:19: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 | #define V_MAX 1e5 + 1
      |               ~~~~^~~
a.cc:11:33: note: in expansion of macro 'V_MAX'
   11 | vector<map<ll, pair<ll, ll>>> G[V_MAX];
      |                                 ^~~~~
a.cc:10:19: error: could not convert '(1.0e+5 + (double)1)' from 'double' to 'long unsigned int'
   10 | #define V_MAX 1e5 + 1
      |               ~~~~^~~
      |                   |
      |                   double
a.cc:11:33: note: in expansion of macro 'V_MAX'
   11 | vector<map<ll, pair<ll, ll>>> G[V_MAX];
      |                                 ^~~~~
a.cc:10:19: error: size of array 'G' has non-integral type 'double'
   10 | #define V_MAX 1e5 + 1
      |               ~~~~^~~
a.cc:11:33: note: in expansion of macro 'V_MAX'
   11 | vector<map<ll, pair<ll, ll>>> G[V_MAX];
      |                                 ^~~~~
a.cc: In function 'bool is_bipartite(long long int, long long int)':
a.cc:7:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::map<long long int, std::pair<long long int, long long int> > >, std::map<long long int, std::pair<long long int, long long int> > >::value_type' {aka 'class std::map<long long int, std::pair<long long int, long long int> >'} has no member named 'first'
    7 | #define fi first
      |            ^~~~~
a.cc:17:26: note: in expansion of macro 'fi'
   17 |         if(color[G[v][i].fi] == c) return false;
      |                          ^~
a.cc:8:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::map<long long int, std::pair<long long int, long long int> > >, std::map<long long int, std::pair<long long int, long long int> > >::value_type' {aka 'class std::map<long long int, std::pair<long long int, long long int> >'} has no member named 'second'
    8 | #define se second
      |            ^~~~~~
a.cc:18:26: note: in expansion of macro 'se'
   18 |         if(color[G[v][i].se] == 0 && !is_bipartite(G[v][i].fi, -c)) return false;
      |                          ^~
a.cc:7:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::map<long long int, std::pair<long long int, long long int> > >, std::map<long long int, std::pair<long long int, long long int> > >::value_type' {aka 'class std::map<long long int, std::pair<long long int, long long int> >'} has no member named 'first'
    7 | #define fi first
      |            ^~~~~
a.cc:18:60: note: in expansion of macro 'fi'
   18 |         if(color[G[v][i].se] == 0 && !is_bipartite(G[v][i].fi, -c)) return false;
      |                                                            ^~
a.cc: In function 'int main()':
a.cc:29:16: error: no matching function for call to 'std::vector<std::map<long long int, std::pair<long long int, long long int> > >::push_back(std::pair<long long int, long long int>)'
   29 |         G[u].pb(mp(v,w));
      |         ~~~~~~~^~~~~~~~~
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::map<long long int, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::map<long long int, std::pair<long long int, long long int> > >; value_type = std::map<long long int, std::pair<long long int, long long 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::pair<long long int, long long int>' to 'const std::vector<std::map<long long int, std::pair<long long int, long long int> > >::value_type&' {aka 'const std::map<long long int, std::pair<long long int, long long 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::map<long long int, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::map<long long int, std::pair<long long int, long long int> > >; value_type = std::map<long long int, std::pair<long long int, long long 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::pair<long long int, long long int>' to 'std::vector<std::map<long long int, std::pair<long long int, long long int> > >::value_type&&' {aka 'std::map<long long int, std::pair<long long int, long long int> >&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:30:16: error: no matching function for call to 'std::vector<std::map<long long int, std::pair<long long int, long long int> > >::push_back(std::pair<long long int, long long int>)'
   30 |         G[v].pb(mp(u,w));
      |         ~~~~~~~^~~~~~~~~
/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::map<long long int, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::map<long long int, std::pair<long long int, long long int> > >; value_type = std::map<long long int, std::pair<long long int, long long 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::pair<long long int, long long int>' to 'const std::vector<std::map<long long int, std::pair<long long int, long long int> > >::value_type&' {aka 'const std::map<long long int, std::pair<long long int, long long 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::map<long long int, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::map<long long int, std::pair<long long int, long long int> > >; value_type = std::map<long long int, std::pair<long long int, long long 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::pair<long long int, long long int>' to 'std::vector<std::map<long long int, std::pair<long long int, long long int> > >::value_type&&' {aka 'std::map<long long int, std::pair<long long int, long long int> >&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~