criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX_N = (int)1e5 + 5;

struct rd {int v, cost;};

int n, m;
int path[MAX_N][MAX_N];

int l, r, d;
ll grid[MAX_N];
bool visited[MAX_N];
vector<vector<rd>> graph(MAX_N);
vector<int> nodes;

int main(void){
  // Here your code !
  fill(visited, visited + MAX_N, false);

  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %d", &l, &r, &d);
    rd tokenl;
    tokenl.v = r;
    tokenl.cost = d;
    graph[l].push_back(tokenl);
    rd tokenr;
    tokenr.v = l;
    tokenr.cost = -1 * d;
    graph[r].push_back(tokenr);
    nodes.push_back(l);
    nodes.push_back(r);
  }

  sort(nodes.begin(), nodes.end());
  nodes.erase(unique(nodes.begin(), nodes.end()), nodes.end());

  stack<int> stk;
  for (int i = 0; i < nodes.size(); ++i) {
    int cnode = nodes[i];
    if (visited[cnode]) continue;
    grid[cnode] = 0;
    visited[cnode] = true;

    stk.push(cnode);
    while (!stk.empty()) {
      int tnode = stk.top();
      stk.pop();
      vector<rd> cgraph = graph[tnode];

      for (int j = 0; j < cgraph.size(); ++j) {
        if (visited[cgraph[j].v]) {
            if (grid[tnode] + cgraph[j].cost != grid[cgraph[j].v]) {
              printf("No\n");
              return 0;
            }
            else {continue;}
        }
        grid[cgraph[j].v] = grid[tnode] + cgraph[j].cost;
        stk.push(cgraph[j].v);
        visited[cgraph[j].v] = true;
      }
    }
  }
  printf("Yes\n");

  return 0;
}

Compiler output:
/tmp/cc72xO3u.o: in function `main':
a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0xa6): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `graph' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0xe1): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/cc72xO3u.o
a.cc:(.text+0xed): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX_N = (int)1e5 + 5;

struct rd {ll v, cost;};

int n, m;
int path[MAX_N][MAX_N];

int l, r, d;
ll grid[MAX_N];
bool visited[MAX_N];
vector<vector<rd>> graph(MAX_N);
vector<int> nodes;

int main(void){
  // Here your code !
  fill(visited, visited + MAX_N, false);

  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %d", &l, &r, &d);
    rd tokenl;
    tokenl.v = r;
    tokenl.cost = d;
    graph[l].push_back(tokenl);
    rd tokenr;
    tokenr.v = l;
    tokenr.cost = -1 * d;
    graph[r].push_back(tokenr);
    nodes.push_back(l);
    nodes.push_back(r);
  }

  sort(nodes.begin(), nodes.end());
  nodes.erase(unique(nodes.begin(), nodes.end()), nodes.end());

  stack<int> stk;
  for (int i = 0; i < nodes.size(); ++i) {
    int cnode = nodes[i];
    if (visited[cnode]) continue;
    grid[cnode] = 0;
    visited[cnode] = true;

    stk.push(cnode);
    while (!stk.empty()) {
      int tnode = stk.top();
      stk.pop();
      vector<rd> cgraph = graph[tnode];

      for (int j = 0; j < cgraph.size(); ++j) {
        if (visited[cgraph[j].v]) {
            if (grid[tnode] + cgraph[j].cost != grid[cgraph[j].v]) {
              printf("No\n");
              return 0;
            }
            else {continue;}
        }
        grid[cgraph[j].v] = grid[tnode] + cgraph[j].cost;
        stk.push(cgraph[j].v);
        visited[cgraph[j].v] = true;
      }
    }
  }
  printf("Yes\n");

  return 0;
}

Compiler output:
/tmp/ccUcG7df.o: in function `main':
a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0xa9): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0xb8): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `graph' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0xe7): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccUcG7df.o
a.cc:(.text+0xf6): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX_N = (int)1e5 + 5;

struct rd {ll v, cost;};

int n, m;
int path[MAX_N][MAX_N];

int l, r, d;
ll grid[MAX_N];
bool visited[MAX_N];
vector<vector<rd>> graph(MAX_N);
vector<int> nodes;

int main(void){
  // Here your code !
  fill(visited, visited + MAX_N, false);

  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %lld", &l, &r, &d);
    rd tokenl;
    tokenl.v = r;
    tokenl.cost = d;
    graph[l].push_back(tokenl);
    rd tokenr;
    tokenr.v = l;
    tokenr.cost = -1 * d;
    graph[r].push_back(tokenr);
    nodes.push_back(l);
    nodes.push_back(r);
  }

  sort(nodes.begin(), nodes.end());
  nodes.erase(unique(nodes.begin(), nodes.end()), nodes.end());

  stack<int> stk;
  for (int i = 0; i < nodes.size(); ++i) {
    int cnode = nodes[i];
    if (visited[cnode]) continue;
    grid[cnode] = 0;
    visited[cnode] = true;

    stk.push(cnode);
    while (!stk.empty()) {
      int tnode = stk.top();
      stk.pop();
      vector<rd> cgraph = graph[tnode];

      for (int j = 0; j < cgraph.size(); ++j) {
        if (visited[cgraph[j].v]) {
            if (grid[tnode] + cgraph[j].cost != grid[cgraph[j].v]) {
              printf("No\n");
              return 0;
            }
            else {continue;}
        }
        grid[cgraph[j].v] = grid[tnode] + cgraph[j].cost;
        stk.push(cgraph[j].v);
        visited[cgraph[j].v] = true;
      }
    }
  }
  printf("Yes\n");

  return 0;
}

Compiler output:
/tmp/ccAHaRss.o: in function `main':
a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0xa9): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0xb8): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `graph' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0xe7): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccAHaRss.o
a.cc:(.text+0xf6): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX_N = (int)1e5 + 5;

struct rd {ll v, cost;};

ll n, m;
ll path[MAX_N][MAX_N];

ll l, r, d;
ll grid[MAX_N];
bool visited[MAX_N];
vector<vector<rd>> graph(MAX_N);
vector<int> nodes;

int main(void){
  // Here your code !
  fill(visited, visited + MAX_N, false);

  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %lld", &l, &r, &d);
    rd tokenl;
    tokenl.v = r;
    tokenl.cost = d;
    graph[l].push_back(tokenl);
    rd tokenr;
    tokenr.v = l;
    tokenr.cost = -1 * d;
    graph[r].push_back(tokenr);
    nodes.push_back(l);
    nodes.push_back(r);
  }

  sort(nodes.begin(), nodes.end());
  nodes.erase(unique(nodes.begin(), nodes.end()), nodes.end());

  stack<int> stk;
  for (int i = 0; i < nodes.size(); ++i) {
    int cnode = nodes[i];
    if (visited[cnode]) continue;
    grid[cnode] = 0;
    visited[cnode] = true;

    stk.push(cnode);
    while (!stk.empty()) {
      int tnode = stk.top();
      stk.pop();
      vector<rd> cgraph = graph[tnode];

      for (int j = 0; j < cgraph.size(); ++j) {
        if (visited[cgraph[j].v]) {
            if (grid[tnode] + cgraph[j].cost != grid[cgraph[j].v]) {
              printf("No\n");
              return 0;
            }
            else {continue;}
        }
        grid[cgraph[j].v] = grid[tnode] + cgraph[j].cost;
        stk.push(cgraph[j].v);
        visited[cgraph[j].v] = true;
      }
    }
  }
  printf("Yes\n");

  return 0;
}

Compiler output:
/tmp/ccGZK7LX.o: in function `main':
a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0x9b): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0xa9): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0xb7): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0xc1): relocation truncated to fit: R_X86_64_PC32 against symbol `graph' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `l' defined in .bss section in /tmp/ccGZK7LX.o
a.cc:(.text+0xf3): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<sstream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=100000+10;
int sz[N],n,x,m,l,r,d,a,b;
struct {
    int s,st,en,t;
}p[N];
void dfs1(int now,int dd){

    if(p[now].s!=-1) {
        sz[p[now].s]+=dd;
        dfs1(p[now].s,dd);
        p[now].st=a;
    }
    else {
        p[now].s=p[a].en;
        p[p[a].en].t=now;
        p[now].st=a;

    }
}
void dfs2(int now,int dd){
    if(p[now].t!=-1) {
        sz[p[now].t]+=dd;
        dfs2(p[now].t,dd);
        p[now].st=a;
    }
    else {
        p[a].en=now;
        p[now].st=a;
    }
}
int main() {
    while(~scanf("%d%d",&n,&m)){
        bool flag=1;
        memset(sz,0,sizeof(sz));
        for(int i=1;i<=n;i++){
            p[i].s=-1;
            p[i].t=-1;
            p[i].st=-1;
            p[i].en=-1;
        }
        for(int i=0;i<m;i++){
            scanf("%d%d%d",&l,&r,&d);
            a=p[l].st==-1?l:p[l].st;
            b=p[r].st==-1?r:p[r].st;
            if(a==b){
                if(sz[l]+d!=sz[r]) flag=0;
            }
            else {
                sz[a].st=a;
                int xxx=sz[l]+d-sz[r];
                sz[r]+=xxx;
                dfs1(r,xxx);
                dfs2(r,xxx);

            }
        }
        if(flag) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:23: error: request for member 'st' in 'sz[a]', which is of non-class type 'int'
   63 |                 sz[a].st=a;
      |                       ^~
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

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

typedef long long ll;

const int kMaxN = 100000;
const int kMaxM = 200000;

int N, M;
int L[kMaxM], R[kMaxM], D[kMaxM];
string ans;

int parent[kMaxN];
int dist[kMaxN];

int Dist(int x) {
  if (parent[x] == x) {
    return 0;
  } else {
    int r = Find(x);
    int d = Dist(parent[x]);
    parent[x] = r;
    dist[x] += d;
    return dist[x];
  }
}

int Find(int x) {
  if (parent[x] == x) {
    return x;
  } else {
    return (parent[x] = Find(parent[x]));
  }
}

bool Same(int x, int y) { return Find(x) == Find(y); }

string Sub() {
  fill(parent, parent+N, -1);
  REP(i, M) {
    int l = L[i];
    int r = R[i];
    int d = D[i];
    if (parent[l] == -1 && parent[r] == -1) {
      parent[l] = r;
      dist[l] = d;
      parent[r] = r;
    } else if (parent[l] == -1 && parent[r] != -1) {
      parent[r] = l;
      dist[r] = -d;
    } else if (parent[l] != -1 && parent[r] == -1) {
      parent[l] = r;
      dist[l] = d;
    } else {
      if (Same(l, r)) {
        if (Dist(l, 0) + d != Dist(r, 0)) { return "No"; }
      } else {
        parent[l] = r;
        dist[l] = d;
      }
    }
  }
  return "Yes";
}

int main() {
  cin >> N >> M;
  REP(i, M) { cin >> L[i] >> R[i] >> D[i]; }
  REP(i, M) {
    --L[i];
    --R[i];
  }

  ans = Sub();

  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int Dist(int)':
a.cc:31:13: error: 'Find' was not declared in this scope
   31 |     int r = Find(x);
      |             ^~~~
a.cc: In function 'std::string Sub()':
a.cc:67:17: error: too many arguments to function 'int Dist(int)'
   67 |         if (Dist(l, 0) + d != Dist(r, 0)) { return "No"; }
      |             ~~~~^~~~~~
a.cc:27:5: note: declared here
   27 | int Dist(int x) {
      |     ^~~~
a.cc:67:35: error: too many arguments to function 'int Dist(int)'
   67 |         if (Dist(l, 0) + d != Dist(r, 0)) { return "No"; }
      |                               ~~~~^~~~~~
a.cc:27:5: note: declared here
   27 | int Dist(int x) {
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int size1 = 220000;

int main() {
	int n, m, ans = 0;
	cin >> n >> m;

	vector<int> res(size1, INT_MIN);
	
	int lmin = INT_MAX, dic = 1;

	for (int i = 0; i < m; ++i) {
		int l, d, r;
		cin >> l >> r >> d;
		if (abs(r - l) == d || abs(r - l) == d - 1 || abs(r - l) == d + 1) {
			++ans;
		}
	}

	if (ans >= m)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;


}		

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'INT_MIN' was not declared in this scope
   13 |         vector<int> res(size1, INT_MIN);
      |                                ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | 
a.cc:15:20: error: 'INT_MAX' was not declared in this scope
   15 |         int lmin = INT_MAX, dic = 1;
      |                    ^~~~~~~
a.cc:15:20: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;

int main(){
    int n,m;
    cin>>n>>m;
    int l[m],r[m],d[m];
    int gap[n][n]={-1};
    cout<<gap[1][1];
    for(int i=0;i<m;i++){
        gap[l[i]][r[i]]=d[m];
    }
    for(int j=0;j<n;j++){
        gap[j][j]=0;
    }
    bool ans=true;
    for(int a=0;a<n;a++){
        for(int b=a;b<n;b++){
            int sum=0;
            if(a==b){
                if(a==0){
                    if(gap[0][1]!=-1&&gap[1][0]!=-1){
                        sum=gap[0][1]-gap[1][0]
                        if(sum!=0){
                            ans=false;
                            goto a;
                        }
                    }
                }else if(a!=n-1){
                    if(gap[a-1][b]!=-1&&gap[a][b+1]!=-1&&gap[a][b-1]!=-1&&gap[a+1][b]!=-1){
                        sum=gap[a-1][b]+gap[a][b+1]-gap[a][b-1]-gap[a+1][b];
                        if(sum!=0){
                            ans=false;
                            goto a;
                        }
                    }
                }else{
                    if(gap[n-2][n-1]!=-1&&gap[n-1][n-2]!=-1){
                        sum=gap[n-2][n-1]-gap[n-1][n-2];
                        if(sum!=0){
                            ans=false;
                            goto a;
                        }
                    }
                }
            }else if(gap[a][b-1]!=-1&&gap[a+1][b]!=-1&&gap[b-1][a]!=-1&&gap[b][a+1]!=-1){
                sum=gap[a-1][b]+gap[a][b+1]-gap[a][b-1]-gap[a+1][b];
                if(sum!=0){
                            ans=false;
                            goto a;
                        }
            }
        }
    }
    a:
    if(ans==true){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:48: error: expected ';' before 'if'
   27 |                         sum=gap[0][1]-gap[1][0]
      |                                                ^
      |                                                ;
   28 |                         if(sum!=0){
      |                         ~~
Language: C++

#include <stdio.h>#include <time.h>#include <stdlib.h>int main(void){int i;srand((unsigned)time(NULL));if(rand()%2) printf("Yes");else printf("No");return 0;}

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>#include <time.h>#include <stdlib.h>int main(void){int i;srand((unsigned)time(NULL));if(rand()%2) printf("Yes");else printf("No");return 0;}
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <array>
using namespace std;

int main() {
	long N, M;
	cin >> N >> M;
	long *per = new long[N];
	long **para = new long*[M];
	for (int i = 0; i < M; i++)
		para[i] = new long[3];
	string str = "Yes";
	for (int i = 0; i < N; i++)
		per[i] = LONG_MIN;
	for (int i = 0; i < M; i++) {
		cin >> para[i][0] >> para[i][1] >> para[i][2];
	}
	sort(&para[0], &para[M], [] (long* x, long* y) {return x[0] < y[0];});

	long count = 0;
	do {
		count = 0;
		for (int i = 0; i < M; i++) {
			long L = para[i][0], R = para[i][1], D = para[i][2];
			if (i == 0) {
				per[L-1] = 0;
				per[R-1] = D;
			} else {
				if (per[L-1] != LONG_MIN && per[R-1] != LONG_MIN) {
					if (per[R-1] - per[L-1] != D)
						str = "No";
				} else if (per[L-1] != LONG_MIN) {
					per[R-1] = per[L-1] + D;
				} else if (per[R-1] != LONG_MIN) {
					per[L-1] = per[R-1] - D;
				} else {
					para[0][count] = L;
					para[1][count] = R;
					para[2][count] = D;
					count++;
				}
			}
		}
		M = count;
	} while (count);
	cout << str << endl;
	for (int i = 0; i < M; i++)
		delete[] para[i];
	delete[] para;
	delete[] per;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: 'LONG_MIN' was not declared in this scope
   17 |                 per[i] = LONG_MIN;
      |                          ^~~~~~~~
a.cc:6:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <array>
  +++ |+#include <climits>
    6 | using namespace std;
a.cc:32:49: error: 'LONG_MIN' was not declared in this scope
   32 |                                 if (per[L-1] != LONG_MIN && per[R-1] != LONG_MIN) {
      |                                                 ^~~~~~~~
a.cc:32:49: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int size1 = 220000;

int main() {
	int n, m, ans = 0;
	cin >> n >> m;

	vector<int> res(size1, 0);
	vector<int> l(m);
	vector<int> r(m);
	vector<int> d(m);

	int lmin = INT_MAX, dic = 1;

	for (int i = 0; i < m; ++i) {
		cin >> l[i] >> r[i] >> d[i];
		lmin = min(l[i], lmin);
		if (res[l[i]] != 0) {
			res[r[i]] = res[l[i]] + d[i];
		}
		else {
			res[l[i]] = dic;
			++dic;
		}
	}


	bool x = true;
	sort(res.begin(), res.end());
	for (int i = 1; i < size1; ++i) {
		if (res[i] != 0 && (res[i] == res[i - 1]))
			x = false;
	}
	if (x) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}

}		

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'INT_MAX' was not declared in this scope
   18 |         int lmin = INT_MAX, dic = 1;
      |                    ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | 
a.cc:27:37: error: 'dic' was not declared in this scope; did you mean 'div'?
   27 |                         res[l[i]] = dic;
      |                                     ^~~
      |                                     div
Language: C++

#include <stdio.h>
#include <time.h>
#include <stdlib.h>
 
int main(void){
    int i;
    srand((unsigned)time(NULL));
    if(rand()%2) printf("Yes");
    else printf("No");
  return 0;
}

Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |     int i;
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |     srand((unsigned)time(NULL));
      | ^
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <queue>
#include <vector>
#include <cstring>
using namespace std;
const int MAX = 1e5+10;
const int INF = 1<<31-1;
bool key, used[MAX], bfsus[MAX];
queue <int> que;
vector < pair <int, int> > edge[MAX];
vector < pair <int, int> >::iterator it;
int cnt[MAX], n, m, l, r, d, tmax, itor, dis[MAX], now, st;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	while (cin >> n >> m) {
		if (m == 0) {
			cout << "Yes" << endl;
			continue;
		}
		memset (cnt, 0, sizeof (cnt));
		memset (dis, -1, sizeof (dis));
		memset (used, 0, sizeof (used));
		memset (bfsus, 0, sizeof (bfsus));
		while (que.size()) que.pop();
		for (int i = 1; i <= n; ++i)
			edge[i].clear();
		key = true;
		st = -1;
		for (int i = 0; i < m; ++i) {
			cin >> l >> r >> d;
			++cnt[r], used[l] = true;
			edge[l].push_back(make_pair(r, d));
		}
		for (int i = 1; i <= n; ++i) {
			if (used[i] && cnt[i] == 0) {
				st = i;
				break;
			}
		}
		if (st == -1) {
			cout << "No" << endl;
			continue;
		}
		que.push(st);
		while (key && que.size()) {
			now = que.front();
			que.pop();
			bfsus[now] = true;
			for (it = edge[now].begin(); it != edge[now].end(); it++) {
				if (bfsus[ed]) {
					key = false;
					break;
				}
				if (dis[it->first] == -1) {
					dis[it->first] = dis[now] + it->second;
				}
				else {
					if (dis[it->first] != dis[now] + it->second) {
						key = false;
						break;
					}
				}
				que.push(it->first);
			}
		}
		if (key)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:43: error: 'ed' was not declared in this scope; did you mean 'd'?
   52 |                                 if (bfsus[ed]) {
      |                                           ^~
      |                                           d
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
 
using namespace std;
int main(void){
    int N,M;
    cin >> N >> M;
    if(M == 0) { cout << "Yes" ; return 0;}
    int L[M],R[M],D[M],x[N];
    for(int i=0;i<M;i++) { cin >> L[i] >> R[i] >> D[i]; }
    for(int i=0;i<N;i++) { x[i] = 0; }
    
    for(int hoge=0;hoge<200;hoge++){
        for(int i=0;i<M;i++) {
            x[R[i]-1] = x[L[i]-1] + D[i];
            if(x[R[i]-1] > 1000000000) { cout << "No" ; return 0; }
        }
    }
 
    //for(int i=0;i<N;i++) {cout << x[i] << endl;}
    for(int i=0;i<M;i++) {
        if(x[R[i]-1] - x[L[i]-1] != D[i]) { cout << "No" ; return 0; }
    }
    cout << "Yes";
    return 0;
}

Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> N >> M;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     if(M == 0) { cout << "Yes" ; return 0;}
      |                  ^~~~
      |                  std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:42: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |             if(x[R[i]-1] > 1000000000) { cout << "No" ; return 0; }
      |                                          ^~~~
      |                                          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:1: error: '\U000000a0' was not declared in this scope
   20 |  
      | ^
a.cc:22:17: error: 'i' was not declared in this scope
   22 |     for(int i=0;i<M;i++) {
      |                 ^
a.cc:25:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |     cout << "Yes";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;





struct man{
  ll id;
  ll x;
};
  

int main(){

  ll n,m;
  cin>>n>>m;
  man men[n+1];
  REP(i,n+1){
    men[i].id = -1;
    men[i].x = 0;
  }
  
  ll l[m],r[m],d[m];
  REP(i,m){
    cin>>l[i]>>r[i]>>d[i];
  }
  
  ll idbase[n+1];
  REP(i,n+1){
    idbase[i] = i;
  }

  list<ll> lis[n+1];
  ll idcount = 0;
  men[0].id = idcount;
  men[0].x = 0;
  lis[0].push_back(0);
  string ans = "Yes";
  REP(i,m){
    if(men[l[i]].id == -1&&men[r[i]].id==-1){
      idcount++;
      men[l[i]].id = idcount;
      men[l[i]].x = 0;
      lis[idcount].push_back(l[i]);
      men[r[i]].id = idcount;
      men[r[i]].x = d[i];
      lis[idcount].push_back(r[i]);
    }else if(men[l[i]].id == -1&&men[r[i]].id!=-1){
      men[l[i]].id = men[r[i]].id;
      men[l[i]].x = men[r[i]].x - d[i];
      lis[men[l[i]].id].push_back(l[i]);
    }else if(men[l[i]].id != -1&&men[r[i]].id==-1){
      men[r[i]].id = men[l[i]].id;
      men[r[i]].x = men[l[i]].x + d[i];
      lis[men[r[i]].id].push_back(r[i]);
    }else if(men[l[i]].id == men[r[i]].id){
      if((men[r[i]].x - men[l[i]].x)!=d[i]){
        ans = "No";
        break;
      }
    }else{
      ll dx = (men[l[i]].x + d[i]) - men[r[i]].x;
      ll lid = men[l[i]].id;
      ll rid = men[r[i]].id;
      while(lis[rid].size() > 0){
        ll l = lis[rid].front();
        lis[rid].pop_front();
        men[l].id = lid;
        men[l].x += dx;
        lis[ld].push_back(l);
      }
    }
  }
  
  
  ll ma,mi;
  ma = 0;
  mi = 0;
  REP(i,n+1){
    ma = max(ma,men[i].x);
    mi = min(mi,men[i].x);
  }
  if(ma-mi>1000000000){
    ans == "No";
    
  }
  
  cout<<ans<<endl;
      
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: 'ld' was not declared in this scope; did you mean 'l'?
   74 |         lis[ld].push_back(l);
      |             ^~
      |             l
a.cc:88:9: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   88 |     ans == "No";
      |     ~~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

#include <stdio.h>
int min(int a, int b){
	return a > b ? b : a;
}
int main(){
  int n, m, i, j, flg = 0;
  scanf("%d%d",&n, &m);
  int x[n], l[m], r[m], d[m];
  for (i = 0; i < m; i++) scanf("%d%d%d",l[i],r[i],d[i]);
  x[l[0]] = 0; x[r[0]] = d[0]; 
  for (i = 1; i < m; i++) {
    int temp;
    temp = x[l[i]] + d[i];
    if(x[r[i]])
      if(x[r[i]] == temp) continue;
      else {printf("No");return 0;}
   printf("Yes");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <deque>
#include <cstdint>

using namespace std;

int main()
{
  struct INFO{
    int L;
    int R;
    int D;
  };

  int N, M;
  cin >> N >> M;

  if (M==0) {
    std::cout << "Yes" << std::endl;
    return 0;
  }
  
  int P[100001];

  for (int p=0; p<=N; ++p)
    P[p] = INT_MAX;

  struct INFO I[200000];

  deque<int> info_to_solve;

  for (int m=0; m<M; ++m) {
    int l, r, d;
    cin >> l >> r >> d;
    I[m].L = l;
    I[m].R = r;
    I[m].D = d;
    info_to_solve.push_back(m);
  }
  
  int info = info_to_solve.front();
  P[I[info].L] = 0;
  P[I[info].R] = I[info].D;
  info_to_solve.pop_front();

  bool flag = true;
  
  while(!info_to_solve.empty() && flag) {
    int i_info = info_to_solve.front();
    info_to_solve.pop_front();
    
    struct INFO& info = I[i_info];

    // cerr << i_info << endl;
    // cerr << P[info.L] << ' ' << P[info.R] << ' ' << info.D << endl;
    
    if (P[info.L]!=INT_MAX) {
      if (P[info.R]==INT_MAX)
	P[info.R] = P[info.L] + info.D;
      else
	flag = (P[info.R] == P[info.L] + info.D);
    } else if (P[info.R]!=INT_MAX) {
      if (P[info.L]==INT_MAX)
	P[info.L] = P[info.R] - info.D;
      else
	flag = (P[info.L] == P[info.R] - info.D);
    } else if (P[info.L]==INT_MAX && P[info.R]==INT_MAX) {
      info_to_solve.push_back(i_info);
    }
  }

  std::cout << (flag ? "Yes" : "No") << std::endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'INT_MAX' was not declared in this scope
   27 |     P[p] = INT_MAX;
      |            ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <cstdint>
  +++ |+#include <climits>
    5 | 
a.cc:58:20: error: 'INT_MAX' was not declared in this scope
   58 |     if (P[info.L]!=INT_MAX) {
      |                    ^~~~~~~
a.cc:58:20: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> P;

struct edge {
    int to, cost;
};
typedef vector<vector<edge> > AdjList;

AdjList graph;
const int INF = 10000009;
vector<int> dist;

void dijkstra(int n, int s){
    dist = vector<int>(n,INF);
    dist[s] = 0;
    priority_queue<P, vector<P>, greater<P> > que;
    que.push(P(0,s));

    while(!que.empty()){
        P p = que.top();
        que.pop();
        int v = p.second;
        if(dist[v] < p.first){
            continue;
        }
        for(int i=0;i < graph[v].size();i++){
            edge e = graph[v][i];
            if(dist[e.to] > dist[v] + e.cost){
                dist[e.to] = dist[v] + e.cost;
                que.push(P(dist[e.to],e.to));
            }
        }
    }
}


int main(void){
    int n, m;
    cin >> n >> m;
    
    graph = AdjList(n+1);
    bool ff = true;
    for(int i=1;i<m+1;i++){
        int from, to, cost;
	
        cin >> from >> to >> cost;
	if(to)
	vvi[from][to] = 1;
	dijkstra(n+1,from);
	int di =  INF;
	if(i != 1 && dist[to] != INF)
	  di = dist[to];
        graph[from].push_back((edge){to,cost});
	dijkstra(n+1,from);
	if(di != cost && di != INF){
	  ff = false;
	  //cout << to << "  " << cost << endl;
	}
    }
    if(ff)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:9: error: 'vvi' was not declared in this scope
   51 |         vvi[from][to] = 1;
      |         ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <deque>

using namespace std;

int main()
{
  struct INFO{
    int L;
    int R;
    int D;
  };

  int N, M;
  cin >> N >> M;

  if (M==0) {
    std::cout << "Yes" << std::endl;
    return 0;
  }
  
  int P[100001];

  for (int p=0; p<=N; ++p)
    P[p] = INT_MAX;

  struct INFO I[200000];

  deque<int> info_to_solve;

  for (int m=0; m<M; ++m) {
    int l, r, d;
    cin >> l >> r >> d;
    I[m].L = l;
    I[m].R = r;
    I[m].D = d;
    info_to_solve.push_back(m);
  }
  
  int info = info_to_solve.front();
  P[I[info].L] = 0;
  P[I[info].R] = I[info].D;
  info_to_solve.pop_front();

  bool flag = true;
  
  while(!info_to_solve.empty() && flag) {
    int i_info = info_to_solve.front();
    info_to_solve.pop_front();
    
    struct INFO& info = I[i_info];

    // cerr << i_info << endl;
    // cerr << P[info.L] << ' ' << P[info.R] << ' ' << info.D << endl;
    
    if (P[info.L]!=INT_MAX) {
      if (P[info.R]==INT_MAX)
	P[info.R] = P[info.L] + info.D;
      else
	flag = (P[info.R] == P[info.L] + info.D);
    } else if (P[info.R]!=INT_MAX) {
      if (P[info.L]==INT_MAX)
	P[info.L] = P[info.R] - info.D;
      else
	flag = (P[info.L] == P[info.R] - info.D);
    } else if (P[info.L]==INT_MAX && P[info.R]==INT_MAX) {
      info_to_solve.push_back(i_info);
    }
  }

  std::cout << (flag ? "Yes" : "No") << std::endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: error: 'INT_MAX' was not declared in this scope
   26 |     P[p] = INT_MAX;
      |            ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <deque>
  +++ |+#include <climits>
    4 | 
a.cc:57:20: error: 'INT_MAX' was not declared in this scope
   57 |     if (P[info.L]!=INT_MAX) {
      |                    ^~~~~~~
a.cc:57:20: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> P;

struct edge {
    int to, cost;
};
typedef vector<vector<edge> > AdjList;

AdjList graph;

const int INF = 10000009;
vector<int> dist;

void dijkstra(int n, int s){
    dist = vector<int>(n,INF);
    dist[s] = 0;
    priority_queue<P, vector<P>, greater<P> > que;
    que.push(P(0,s));

    while(!que.empty()){
        P p = que.top();
        que.pop();
        int v = p.second;
        if(dist[v] < p.first){
            continue;
        }
        for(int i=0;i < graph[v].size();i++){
            edge e = graph[v][i];
            if(dist[e.to] > dist[v] + e.cost){
                dist[e.to] = dist[v] + e.cost;
                que.push(P(dist[e.to],e.to));
            }
        }
    }
}


int main(void){
    int n, m;
    cin >> n >> m;
    vvi = vector<vector<int>>(100001, vector<int>(100001, 0));
    graph = AdjList(n+1);
    bool ff = true;
    for(int i=1;i<m+1;i++){
        int from, to, cost;
	
        cin >> from >> to >> cost;
	if(to)
	vvi[from][to] = 1;
	dijkstra(n+1,from);
	int di =  INF;
	if(i != 1 && dist[to] != INF)
	  di = dist[to];
        graph[from].push_back((edge){to,cost});
	dijkstra(n+1,from);
	if(di != cost && di != INF){
	  ff = false;
	  //cout << to << "  " << cost << endl;
	}
    }
    if(ff)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'vvi' was not declared in this scope
   44 |     vvi = vector<vector<int>>(100001, vector<int>(100001, 0));
      |     ^~~
Language: C++

#include<cstdio>
#include<iostream>
using namespace std;
int main(void)
{
	int m,n;
	int a[100005];
	bool f[100005] = {0};
	cin>>m>>n;
	for(int i = 0; i < n; i++){
		int x,y,d;
		cin>>x>>y>>d;
		if(f[y]&&f[x]){
			if(a[x]-a[y] != d){
				puts("No");
				return 0;
			}
		}
		else{
			f[y] = 1;
			x[y] = 1;
			a[y] = a[x] - d;
		}
	}
	puts("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: invalid types 'int[int]' for array subscript
   21 |                         x[y] = 1;
      |                          ^
Language: C++

#include<iostream>
#include<math.h>
#include<stdio.h>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<vector>
#include<string.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

const int maxn = 100005;
const int Mod=1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;

#define Se second
#define Fi first
int n,m;
int  l,r,d;
int book[maxn];
int num[maxn];
int con[maxn][maxn];
int flag;
vector<int> v[maxn];
void dfs(int x)
{
    if(flag==1)
        return ;
    for(int i=0;i<v[x].size();i++)
    {
        int pos=v[x][i];
         if(book[pos]==0)
         {
             book[pos]=1;
             num[pos]=num[x]+con[x][pos];
             dfs(pos);
         }
         else
         {
             if(num[pos]!=num[x]+con[x][pos])
             {
                 flag=1;
                 return ;
             }
         }
    }
    return ;
}
int main()
{
    cin>>n>>m;
    flag=0;
    while(m--)
    {
        cin>>l>>r>>d;
        v[l].push_back(r);
        v[r].push_back(l);
        con[l][r]=d;
        con[r][l]=-d;
    }
    for(int i=1;i<=n;i++)
    {
        if(flag==1)
            break;
        if(book[i]==0)
        {
            book[i]=1;
            num[i]=0;
            dfs(i);
        }
    }
    if(flag==1)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
    }
    return 0;
}


Compiler output:
/tmp/cc1f2vTf.o: in function `dfs(int)':
a.cc:(.text+0xe): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x3d): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x150): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x17a): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc1f2vTf.o
/tmp/cc1f2vTf.o: in function `main':
a.cc:(.text+0x1d8): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x241): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x273): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x31c): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x394): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/cc1f2vTf.o
/tmp/cc1f2vTf.o: in function `__tcf_0':
a.cc:(.text+0x40c): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc1f2vTf.o
a.cc:(.text+0x413): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <string>
#include <string.h>
#include <iostream>
#include <queue>
#include <math.h>
#include <stdio.h>
using namespace std;
typedef  long long  LL;
struct node
{
	LL l,r,d;

}a[200200];

bool cmd(node a, node b)
{
	if(a.l!=b.l){
		return a.l<b.l;
	}
	return a.r<b.r;

}
LL flag[200200];
LL dis[200200];
int main()
{
	LL n,m;
	scanf("%lld %lld",&n,&m);
	for(LL i=1;i<=m;i++){
		LL l,r,d;
		scanf("%lld %lld %lld",&l,&r,&d);
		if(l>r){
			swap(l, r);
			d=-d;
		}
		a[i].l=l;
		a[i].r=r;
		a[i].d=d;
	}
	sort(a+1,a+1+m,cmd);
	for(int i=1;i<=m;i++){
		printf("%d %d %d\n",a[i].l,a[i].r,a[i].d);
	}
	flag[a[1].l]=1;
	dis[a[1].l]=100;
	LL i;
	for(i=1;i<=m;i++){
		LL aa=a[i].l;
		LL bb=a[i].r;
		if(flag[a[i].l]==0&&flag[a[i].r]==0){
			flag[a[i].l]=flag[a[i].r]=1;
			dis[a[i].l]=100;
			dis[a[i].r]=100+a[i].d;
		}else if(flag[aa]==1&&flag[bb]==0){
			flag[bb]=1;
			dis[bb]=dis[aa]+a[i].d;
		}else if(flag[aa]==1&&flag[bb]==1){
			if(dis[bb]-dis[aa]!=a[i].d){
				break;
			}
		}else{
			flag[aa]=1;
			dis[aa]=dis[bb]-a[i].d;
		}
	}
	if(i!=m+1){
		printf("No\n");
	}else
		printf("Yes\n");

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   40 |         sort(a+1,a+1+m,cmd);
      |         ^~~~
      |         sqrt
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];
            }
            else que.push(mp(l[i],r[i]));
    }


    Yes(flag);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:108:2: error: expected '}' at end of input
  108 | }
      |  ^
a.cc:57:11: note: to match this '{'
   57 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define LL long long
using namespace std;

const LL mod=1e9+7;
LL n,r=2,t1=10,num1=1,pre[15],ans=0;
LL t2=10,num2=1,cnt=1;

LL pow(LL a,LL b){
	LL ans=1;
	while(b)
	{
		if(b&1) ans=ans*a%mod;
		a=a*a%mod;b>>=1;
	}
	return ans;
}

void check(LL len){
	if(len<num1) 
        return;
	LL num=n/len,tot=9*pow(10,len-1)%mod;
	(ans+=(tot-num+1)%mod)%=mod;
}

LL down(LL a,LL b) {
    return a%b==0?a/b-1:a/b;
}

LL up(LL a,LL b) {return a/b+1;}

int main(){
	scanf("%lld",&n);
	pre[0]=1;for(LL i=1;i<=8;i++) pre[i]=pre[i-1]*10;
	if(n>9){
		for(LL i=1;;i++){
			if(i==t1){
				t1*=10,num1++;
				if(num1*pre[num1-1]*9>=n) 
                    break;
			}
			while(cnt<n){
				if(cnt+num2>n) 
                    break;
				cnt+=num2;
				r++;if(r==t2) t2*=10,num2++;
			}
			if(cnt==n) (ans+=1)%=mod;
			cnt-=num1;
		}
	}
	for(LL i=1;i*i<=n;i++)
	{
		if(n%i==0)
		{
			check(i);
			if(i*i!=n) check(n/i);
		}
	}
	for(LL i=num1;i<=n/2;i++)
	{
		LL R=down(n,i),L=up(n,i+1);
		if(L<=R) (ans+=(R-L+1))%=mod;
	}
	printf("%lld",(ans+mod)%mod);
}

Compiler output:
a.cc: In function 'void check(long long int)':
a.cc:22:41: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const long long int' to binary 'operator%'
   22 |         LL num=n/len,tot=9*pow(10,len-1)%mod;
      |                          ~~~~~~~~~~~~~~~^~~~
      |                           |              |
      |                           |              const long long int
      |                           __gnu_cxx::__promote<double>::__type {aka double}