Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define F first
#define S second
#define FBO find_by_order
#define OOK order_of_key
#define mset(m,v) memset((m),(v),sizeof(m))
#define inrep int TC;cin>>TC;while(TC--)
#define cppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PI 3.1415926535897932384626433832795028841971693993751
#define trace1(x) cerr<<#x<<": "<<x<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<"\n"
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"\n"

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

// SOLUTION

int main() {
	cppio;
	int n, m;
	cin >> n >> m;
	ll pos[n + 2];
	mset (pos, 0);
	ll l, r, d;
	vector < pair <pll, ll> > st;
	while (m--) {
		cin >> l >> r >> d;
		if(l > r) swap(l, r);
		st.EB(MP(MP(l, r), d));
	}
	sort (st.begin(), st.end());
	for (auto i : st) {
		pos[i.F.S] = pos[i.F.F] + i.S;
	}
	// for(int i = 1; i <= n; i++) pos[i] += pos[i - 1];
	// for(int i = 1; i <= n; i++) cout << pos[i] << " "; cout << "\n";
	bool ok = true;
	for (auto i : st) {
		if(pos[i.F.S] != pos[i.F.F] + i.S) ok = false;
	}#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define F first
#define S second
#define FBO find_by_order
#define OOK order_of_key
#define mset(m,v) memset((m),(v),sizeof(m))
#define inrep int TC;cin>>TC;while(TC--)
#define cppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PI 3.1415926535897932384626433832795028841971693993751
#define trace1(x) cerr<<#x<<": "<<x<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<"\n"
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"\n"

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

// SOLUTION

int main() {
	cppio;
	int n, m;
	cin >> n >> m;
	ll pos[n + 2];
	mset (pos, 0);
	ll l, r, d;
	vector < pair <pll, ll> > st;
	while (m--) {
		cin >> l >> r >> d;
		if(l > r) swap(l, r);
		st.EB(MP(MP(l, r), d));
	}
	sort (st.begin(), st.end());
	bool ok = true;
	for (auto i : st) {
		pos[i.F.S] = pos[i.F.F] + i.S;
		if(pos[i.F.S] > 1e9) ok = false;
	}
	// for(int i = 1; i <= n; i++) pos[i] += pos[i - 1];
	// for(int i = 1; i <= n; i++) cout << pos[i] << " "; cout << "\n";
	for (auto i : st) {
		if(pos[i.F.S] != pos[i.F.F] + i.S) ok = false;
	}
	if(ok) cout << "Yes";
	else cout << "No";
	return 0;
}


Compiler output:
a.cc:57:10: error: stray '#' in program
   57 |         }#include <bits/stdc++.h>
      |          ^
a.cc: In function 'int main()':
a.cc:57:11: error: 'include' was not declared in this scope
   57 |         }#include <bits/stdc++.h>
      |           ^~~~~~~
a.cc:57:20: error: 'bits' was not declared in this scope
   57 |         }#include <bits/stdc++.h>
      |                    ^~~~
a.cc:57:25: error: 'stdc' was not declared in this scope; did you mean 'std'?
   57 |         }#include <bits/stdc++.h>
      |                         ^~~~
      |                         std
a.cc:61:1: error: expected primary-expression before 'using'
   61 | using namespace std;
      | ^~~~~
a.cc:91:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   91 | int main() {
      |         ^~
a.cc:91:9: note: remove parentheses to default-initialize a variable
   91 | int main() {
      |         ^~
      |         --
a.cc:91:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:91:12: error: a function-definition is not allowed here before '{' token
   91 | int main() {
      |            ^
a.cc:118:2: error: expected '}' at end of input
  118 | }
      |  ^
a.cc:35:12: note: to match this '{'
   35 | int main() {
      |            ^