Language: C++

//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

struct edge{
    int to;
    int cost;
};
signed main(){
    int n,m; cin >> n >> m;
    vector<vector<edge>> G(n);
    vector<bool> st(n,1);
    int l[m],r[m],d[m];
    rep(i,m)
        cin >> l[i] >> r[i] >> d[i];
        l[i]--; r[i]--;
        st[r[i]]=0;
        G[l[i]].pb({r[i],d[i]});
    }
    int maa=0;
    vector<int> x(n,0);
    vector<int> s;
    rep(i,n){
        if(st[i]){
            s.pb(i);
        }
    }
    rep(j,s.size()){
        int i=s[j];
        x[i]=0;
        queue<int> q; q.push(i);
        while(!q.empty()){
            int v=q.front(); q.pop();
            for(auto u:G[v]){
                x[u.to]=x[v]+u.cost;
                chmax(maa,x[u.to]);
                q.push(u.to);
                if(maa>1000000000){
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    rep(i,m){
        if(x[r[i]]-x[l[i]]!=d[i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:11: error: 'i' was not declared in this scope
   53 |         l[i]--; r[i]--;
      |           ^
a.cc: At global scope:
a.cc:58:19: error: 'n' was not declared in this scope; did you mean 'yn'?
   58 |     vector<int> x(n,0);
      |                   ^
      |                   yn
a.cc:30:18: error: expected unqualified-id before 'for'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:60:5: note: in expansion of macro 'rep'
   60 |     rep(i,n){
      |     ^~~
a.cc:60:9: error: 'i' does not name a type
   60 |     rep(i,n){
      |         ^
a.cc:30:30: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:60:9: error: 'i' does not name a type
   60 |     rep(i,n){
      |         ^
a.cc:30:36: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:30:18: error: expected unqualified-id before 'for'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:65:5: note: in expansion of macro 'rep'
   65 |     rep(j,s.size()){
      |     ^~~
a.cc:65:9: error: 'j' does not name a type
   65 |     rep(j,s.size()){
      |         ^
a.cc:30:30: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:65:9: error: 'j' does not name a type
   65 |     rep(j,s.size()){
      |         ^
a.cc:30:36: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:30:18: error: expected unqualified-id before 'for'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:82:5: note: in expansion of macro 'rep'
   82 |     rep(i,m){
      |     ^~~
a.cc:82:9: error: 'i' does not name a type
   82 |     rep(i,m){
      |         ^
a.cc:30:30: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:82:9: error: 'i' does not name a type
   82 |     rep(i,m){
      |         ^
a.cc:30:36: note: in definition of macro 'rep'
   30 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:88:5: error: 'cout' does not name a type
   88 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:89:5: error: expected unqualified-id before 'return'
   89 |     return 0;
      |     ^~~~~~
a.cc:90:1: error: expected declaration before '}' token
   90 | }
      | ^