Language: C++

#include<iostream>
#include<vector>
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
map<ll, vector<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:12:1: error: 'map' does not name a type; did you mean 'mp'?
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      | ^~~
      | mp
a.cc:12:7: error: expected unqualified-id before ',' token
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |       ^
a.cc:4:17: error: wrong number of template arguments (1, should be 2)
    4 | #define ll long long;
      |                 ^~~~
a.cc:12:21: note: in expansion of macro 'll'
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |                     ^~
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:3013:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
 3013 |     struct pair;
      |            ^~~~
a.cc:12:16: error: template argument 1 is invalid
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |                ^
a.cc:12:16: error: template argument 2 is invalid
a.cc:12:23: error: expected unqualified-id before ',' token
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |                       ^
a.cc:4:12: error: expected unqualified-id before 'long'
    4 | #define ll long long;
      |            ^~~~
a.cc:12:25: note: in expansion of macro 'll'
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |                         ^~
a.cc:12:27: error: expected unqualified-id before '>>' token
   12 | map<ll, vector<pair<ll, ll>>> G[V_MAX];
      |                           ^~
a.cc:4:17: error: template argument 1 is invalid
    4 | #define ll long long;
      |                 ^~~~
a.cc:13:8: note: in expansion of macro 'll'
   13 | vector<ll> color(V_MAX,0);
      |        ^~
a.cc:4:17: error: template argument 2 is invalid
    4 | #define ll long long;
      |                 ^~~~
a.cc:13:8: note: in expansion of macro 'll'
   13 | vector<ll> color(V_MAX,0);
      |        ^~
a.cc:13:10: error: expected unqualified-id before '>' token
   13 | vector<ll> color(V_MAX,0);
      |          ^
a.cc:4:21: error: expected ')' before ';' token
    4 | #define ll long long;
      |                     ^
a.cc:15:19: note: in expansion of macro 'll'
   15 | bool is_bipartite(ll v, ll c){
      |                   ^~
a.cc:15:18: note: to match this '('
   15 | bool is_bipartite(ll v, ll c){
      |                  ^
a.cc:15:22: error: 'v' does not name a type
   15 | bool is_bipartite(ll v, ll c){
      |                      ^
a.cc:15:28: error: 'c' does not name a type
   15 | bool is_bipartite(ll v, ll c){
      |                            ^
a.cc: In function 'int main()':
a.cc:4:17: error: declaration does not declare anything [-fpermissive]
    4 | #define ll long long;
      |                 ^~~~
a.cc:25:5: note: in expansion of macro 'll'
   25 |     ll n; cin >> n;
      |     ^~
a.cc:25:8: error: 'n' was not declared in this scope
   25 |     ll n; cin >> n;
      |        ^
a.cc:4:17: error: declaration does not declare anything [-fpermissive]
    4 | #define ll long long;
      |                 ^~~~
a.cc:28:9: note: in expansion of macro 'll'
   28 |         ll u, v, w;
      |         ^~
a.cc:28:12: error: 'u' was not declared in this scope
   28 |         ll u, v, w;
      |            ^
a.cc:28:15: error: 'v' was not declared in this scope
   28 |         ll u, v, w;
      |               ^
a.cc:28:18: error: 'w' was not declared in this scope
   28 |         ll u, v, w;
      |                  ^
a.cc:30:9: error: 'G' was not declared in this scope
   30 |         G[u].pb(mp(v,w));
      |         ^
a.cc:7:21: error: expected ')' before ';' token
    7 | #define mp make_pair;
      |                     ^
a.cc:30:17: note: in expansion of macro 'mp'
   30 |         G[u].pb(mp(v,w));
      |                 ^~
a.cc:30:16: note: to match this '('
   30 |         G[u].pb(mp(v,w));
      |                ^
a.cc:7:21: error: statement cannot resolve address of overloaded function
    7 | #define mp make_pair;
      |                     ^
a.cc:30:17: note: in expansion of macro 'mp'
   30 |         G[u].pb(mp(v,w));
      |                 ^~
a.cc:7:21: error: expected ')' before ';' token
    7 | #define mp make_pair;
      |                     ^
a.cc:31:17: note: in expansion of macro 'mp'
   31 |         G[v].pb(mp(u,w));
      |                 ^~
a.cc:31:16: note: to match this '('
   31 |         G[v].pb(mp(u,w));
      |                ^
a.cc:7:21: error: statement cannot resolve address of overloaded function
    7 | #define mp make_pair;
      |                     ^
a.cc:31:17: note: in expansion of macro 'mp'
   31 |         G[v].pb(mp(u,w));
      |                 ^~
a.cc:34:20: error: too many arguments to function 'bool is_bipartite(long long int)'
   34 |     if(is_bipartite(0, 1)){
      |        ~~~~~~~~~~~~^~~~~~
a.cc:15:6: note: declared here
   15 | bool is_bipartite(ll v, ll c){
      |      ^~~~~~~~~~~~
a.cc:35:28: error: 'color' was not declared in this scope; did you mean 'tolower'?
   35 |         rep(i,0,n) cout << color[i] << endl;
      |                            ^~~~~
      |                            tolower
a.cc:35:34: error: 'i' was not declared in this scope; did you mean 'fi'?
   35 |         rep(i,0,n) cout << color[i] << endl;
      |                                  ^
      |                                  fi