Language: C++

// g++ macro.cpp -std=c++14
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

#define ALL(obj) (obj).begin(),(obj).end()

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision; // cpp_int

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>

#define pb(a) push_back(a)
#define mp make_pair


int main(){

    CIN(n,m);
    V l(m);V r(m);V d(m);
    REP(i,m)cin>>l[i]>>r[i]>>d[i];

    queue<P> que;

    map<int,ll> map_;
    bool flag=true;
    REP(i,m){
        if(map_.empty()){
            map_[l[i]]=0;
            map_[r[i]]=d[i];
        }
        else{
            if(map_.count(l[i])){
                if(map_.count(r[i])){
                    if(map_[r[i]]-map_[l[i]]!=d[i]){flag=false;break;}// ryouhou
                }
                else map_[r[i]] = 1LL*map_[l[i]]+d[i];
            }
            else if(map_.count(r[i])){
                map_[l[i]]=1LL*map_[r[i]]-d[i];
            }
            else que.push(mp(l[i],r[i]));
        }
        
    }
    int ttt=que.size();
    REP(i,ttt){
        if(map_.empty()){
            map_[l[i]]=0;
            map_[r[i]]=d[i];
        }
        else{
            if(map_.count(l[i])){
                if(map_.count(r[i])){
                    if(map_[r[i]]-map_[l[i]]!=d[i]){flag=false;break;}// ryouhou
                }
                else map_[r[i]] = 1LL*map_[l[i]]+d[i];
            }
            else if(map_.count(r[i])){
                map_[l[i]]=1LL*map_[r[i]]-d[i];


Compiler output:
a.cc: In function 'int main()':
a.cc:100:48: error: expected '}' at end of input
  100 |                 map_[l[i]]=1LL*map_[r[i]]-d[i];
      |                                                ^
a.cc:99:38: note: to match this '{'
   99 |             else if(map_.count(r[i])){
      |                                      ^
a.cc:100:48: error: expected '}' at end of input
  100 |                 map_[l[i]]=1LL*map_[r[i]]-d[i];
      |                                                ^
a.cc:92:13: note: to match this '{'
   92 |         else{
      |             ^
a.cc:100:48: error: expected '}' at end of input
  100 |                 map_[l[i]]=1LL*map_[r[i]]-d[i];
      |                                                ^
a.cc:87:15: note: to match this '{'
   87 |     REP(i,ttt){
      |               ^
a.cc:100:48: error: expected '}' at end of input
  100 |                 map_[l[i]]=1LL*map_[r[i]]-d[i];
      |                                                ^
a.cc:57:11: note: to match this '{'
   57 | int main(){
      |           ^