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

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <climits>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>

#define ll long long

using namespace std;

const ll INF = LLONG_MAX / 2 - 1;


struct Edge {
	ll t;
	ll c;
	Edge(ll to, ll cost):t(to),c(cost){}
	Edge(){}
};

vector<ll> weigh;
ll R, C;

bool DFS(ll node, vector<vector<Edge> >& edge, ll& xmin, ll& ymin) {
	if (node < R) xmin = min(xmin, weigh[node]);
	else ymin = min(ymin, weigh[node]);
	for (auto &to : edge[node]) {
		if (weigh[to.t] == INF) {
			weigh[to.t] = to.c - weigh[node];
			if (not DFS(to.t, edge, xmin, ymin)) return false;
		}
		else {
			if (weigh[to.t] + weigh[node] != to.c) return false;
		}
	}
	return true;
}
int main() {
	cin >> R >> C;
	ll N;
	cin >> N;
	weigh.resize(R + C, INF);
	vector<vector<Edge> > edge(R+C);
	for(int i = 0; i < N; i++){
		ll r, c, a; cin >> r >> c >> a;
		--r; --c;
		edge[r].push_back(Edge(R+c,a));
		edge[R+c].push_back(Edge(r, a));
	}

	bool res = true;
	ll xmin, ymin;
	for(int i = 0; i < R + C; i++){
		if(weigh[i] == INF and edge[i].size() > 0) {
			xmin = ymin = numeric_limits<int>::max();
			weigh[i] = 0;
			if (not DFS(i,edge,xmin,ymin) or xmin+ymin < 0) {
				cout << "No" << endl;
				return;
			}
		}
	}
	cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   68 |                                 return;
      |                                 ^~~~~~
Language: C++

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <climits>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>

#define DIV 1000000007
const ll INF = LLONG_MAX / 2 - 1;

using namespace std;

long long R, C, N;
long long r[100005];
long long c[100005];
long long a[100005];
long long w[100005];

vector<pair<long long, long long> > tree[200005];

bool dfs(int node){
	for(int i = 0; i < tree[node].size(); i++){
		long long next = tree[node][i].first;
		long long wei = tree[node][i].second;
		if(w[next] == INF){
			w[next] = wei - w[node];
			if(dfs(next) == false){
				return false;
			}
		}else{
			if(w[next] + w[node] != wei){
				return false;
			}
		}
	}
	return true;
}

int main(){
	cin >> R >> C >> N;
	for(int i = 0; i < N; i++){
		cin >> r[i] >> c[i] >> a[i];
		r[i]--;c[i]--;
		tree[r[i]].push_back(make_pair(R + c[i], a[i]));
		tree[R + c[i]].push_back(make_pair(r[i], a[i]));
	}

	for(int i = 0; i < R + C; i++){
		w[i] = INF;
	}
	
	for(int i = 0; i < R + C; i++){
		if(w[i] != INF){
			continue;
		}
		w[i] = 0;
		if(dfs(i) == false){
			cout << "No" << endl;
			return 0;
		}
	}

	long long xmin = INF;
	long long ymin = INF;

	for(int i = 0; i < R; i++){
		xmin = min(xmin, w[i]);
	}
	for(int i = R; i < R + C; i++){
		ymin = min(ymin, w[i]);
	}
	if(xmin + ymin < 0){
		cout << "No" << endl;
	}else{
		cout << "Yes" << endl;
	}

}

Compiler output:
a.cc:17:7: error: 'll' does not name a type
   17 | const ll INF = LLONG_MAX / 2 - 1;
      |       ^~
a.cc: In function 'bool dfs(int)':
a.cc:33:31: error: 'INF' was not declared in this scope
   33 |                 if(w[next] == INF){
      |                               ^~~
a.cc: In function 'int main()':
a.cc:57:24: error: 'INF' was not declared in this scope
   57 |                 w[i] = INF;
      |                        ^~~
a.cc:61:28: error: 'INF' was not declared in this scope
   61 |                 if(w[i] != INF){
      |                            ^~~
a.cc:71:26: error: 'INF' was not declared in this scope
   71 |         long long xmin = INF;
      |                          ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef pair<ll,ll> pll;

#define reps(i,f,n) for(int i = int(f); i <= int(n); i++)
#define rep(i,n) reps(i,0,int(n)-1)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)

#define all(x) (x).begin(),(x).end()
#define X first
#define Y second

#define sz size()
#define eb emplace_back
#define pb push_back

vector<pii> p[2][200000];

int u[2][200000];
int m[2];
const int INF=1000000000;

bool dfs(int now, int to, int pos){
  bool ret = true;
  rep(i, p[pos][to].sz){
    int next = p[pos][to][i].X;
    int val = p[pos][to][i].Y;
    if(u[1-pos][next] == INF){
      u[1-pos][next] = val-now;
      m[1-pos] = min(m[1-pos], u[1-pos][next]);
      ret &= dfs(u[1-pos][next], next, 1-pos);
    }else if(u[1-pos][next] != val-now){
      return false;
    }
  }
  return ret;
}


int main(void){
  int r,c,n;
  int x,y,a;
  cin >> r >> c;
  cin >> n;
  rep(i,n){
    cin >> x >> y >> a;
    x--;y--;
    p[0][x].pb(make_pair(y,a));p[1][y].pb(make_pair(x,a));
  }
  
  rep(i, r)u[0][i] = INF;
  rep(i, c)u[1][i] = INF;

  bool ret = true;
  bool r = true;

  rep(i,r){
    if(u[0][i] == INF){
      u[0][i] = 0;
      m[0] = 0;m[1] = INF;
      ret &= dfs(0, i, 0);
      if(m[0] + m[1] < 0)r = false;
    }
  }

  ret = true;
  rep(i,r){
    rep(j, p[0][i].sz){
      if( u[0][i] + u[1][p[0][i][j].X] == p[0][i][j].Y){
        ret = false;
      }
    }
  }

  if(ret&r) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:8: error: conflicting declaration 'bool r'
   60 |   bool r = true;
      |        ^
a.cc:46:7: note: previous declaration as 'int r'
   46 |   int r,c,n;
      |       ^
Language: C++

class _in{struct my_iterator{int it;const bool rev;explicit constexpr my_iterator(int it_, bool rev=false):it(it_),rev(rev){}constexpr int operator*(){return it;}constexpr bool operator!=(my_iterator& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const my_iterator i,n;public:explicit constexpr _in(int n):i(0),n(n){}explicit constexpr _in(int i,int n):i(i,n<i),n(n){}constexpr const my_iterator& begin(){return i;}constexpr const my_iterator& end(){return n;}};

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

using i64 = long long;
const i64 INF = 1e18;

int R, C, N;
const int MAX_V = 200010;
vector<pair<int, i64>> adj[MAX_V];
bool used[MAX_V];
i64 weight[MAX_V];
void dfs(int cur_v, i64& minR, i64& minC) {
    used[cur_v] = true;
    for(const auto& e : adj[cur_v]) {
        int nxt_v; i64 cost
        tie(nxt_v, cost) = e;
        i64 w = cost - weight[cur_v];
        if(used[nxt_v]) {
            if(w != weight[nxt_v])
              minC = minR = -INF;
            continue;
        }
        
        weight[nxt_v] = w;
        if(nxt_v < R)
          minR = min(minR, w);
        else
          minC = min(minC, w);
        dfs(nxt_v, minR, minC);
    }
}

int main() {
    cin >> R >> C >> N;
    for(int _ : _in(N)) {
        int r, c;
        i64 x;
        cin >> r >> c >> x;
        --r;
        --c;
        c += R;
        adj[r].emplace_back(c, x);
        adj[c].emplace_back(r, x);
    }
    for(int i : _in(R)) if(!used[i]) {
        i64 minR = 0LL, minC = INF;
        weight[i] = 0LL;
        dfs(i, minR, minC);
        if(minC + minR < 0LL) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, i64&, i64&)':
a.cc:18:9: error: expected initializer before 'tie'
   18 |         tie(nxt_v, cost) = e;
      |         ^~~
a.cc:19:17: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   19 |         i64 w = cost - weight[cur_v];
      |                 ^~~~
      |                 cosl
Language: C

//Task D
/*
    Grid and Integers
    Magic Sum/REctangles
*/
#include <stdio.h>
#include <stdlib.h>
 
int main(){
    int R, C;
    scanf("%d %d",&R,&C);
    int N;
    scanf("%d"&N);
    int r = 0;
    int c = 0;
    int a = 0;
    
    int** array = calloc(R,sizeof(int));
    int x = 0; //generic counter
    while(x < C){
        array[x] = calloc(C,sizeof(int));
        x++;
    }
    x = 0;
    
    while(x < N){
        scanf("%d %d %d",&r,&c,&a);
        array[r][c] = a;
        x++;
    }
 
/*
I want to see more cases (ie the soln/test cases)
*/
    return EXIT_SUCCESS;
}

Compiler output:
main.c: In function 'main':
main.c:13:15: error: invalid operands to binary & (have 'char *' and 'int')
   13 |     scanf("%d"&N);
      |           ~~~~^
      |           |
      |           char *
Language: C

//Task D
/*
    Grid and Integers
    Magic Sum/REctangles
*/
#include <stdio.h>
#include <stlib.h>

int main(){
    int R, C;
    scanf("%d %d",&R,&C);
    int N;
    scanf("%d"&N);
    int r = 0;
    int c = 0;
    int a = 0;
    
    int** array = calloc(R,sizeof(int));
    int x = 0; //generic counter
    while(x < C){
        array[x] = calloc(C,sizeof(int));
        x++;
    }
    x = 0;
    
    while(x < N){
        scanf("%d %d %d",&r,&c,&a);
        array[r][c] = a;
        x++;
    }

/*
I want to see more cases (ie the soln/test cases)
*/
    return EXIT_SUCCESS;
}

Compiler output:
main.c:7:10: fatal error: stlib.h: No such file or directory
    7 | #include <stlib.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;
const LL INF = 1e15;

int R, C, N;
void dfs(auto& G, int u, int p, vector<LL>& xs, LL& mr, LL& mc){
  if(u < R) mr = min(mr, xs[u]);
  else mc = min(mc, xs[u]);
  for(auto&& e: G[u]){
	if(e.FF == p) continue;
	if(xs[e.FF] != INF) continue;
	xs[e.FF] = e.SS - xs[u];
	dfs(G, e.FF, u, xs);
  }
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  cin >> R >> C >> N;
  vector<vector<pair<int,LL>>> G(R+C);
  REP(i,N){
	int r, c, x; cin >> r >> c >> x;
	--r, --c;
	G[r].EB(R+c, x);
	G[R+c].EB(r, x);
  }

  vector<LL> xs(R+C, INF);
  REP(i,R+C){
	if(xs[i] == INF){
	  xs[i] = 0;
	  LL mr = INF, mc = INF;
	  dfs(G, i, -1, xs, mr, mc);
	  if(mr+mc < 0){
		cout << "No" << endl;
		return 0;
	  }
	}
  }

  REP(i,R+C){
	for(auto&& e: G[i])
	  if(e.SS != xs[i] + xs[e.FF]){
		cout << "No" << endl;
		return 0;
	  }
  }
  cout << "Yes" << endl;

  return 0;
}


Compiler output:
a.cc:35:10: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   35 | void dfs(auto& G, int u, int p, vector<LL>& xs, LL& mr, LL& mc){
      |          ^~~~
a.cc: In instantiation of 'void dfs(auto:28&, int, int, std::vector<long long int>&, LL&, LL&) [with auto:28 = std::vector<std::vector<std::pair<int, long long int> > >; LL = long long int]':
a.cc:64:7:   required from here
   64 |           dfs(G, i, -1, xs, mr, mc);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:42:12: error: no matching function for call to 'dfs(std::vector<std::vector<std::pair<int, long long int> > >&, int&, int&, std::vector<long long int>&)'
   42 |         dfs(G, e.FF, u, xs);
      |         ~~~^~~~~~~~~~~~~~~~
a.cc:35:6: note: candidate: 'template<class auto:28> void dfs(auto:28&, int, int, std::vector<long long int>&, LL&, LL&)'
   35 | void dfs(auto& G, int u, int p, vector<LL>& xs, LL& mr, LL& mc){
      |      ^~~
a.cc:35:6: note:   candidate expects 6 arguments, 4 provided
Language: C++

#include <iostream>
#include <map>
#define int long long
using namespace std;

int h, w;
int n;
int r, c, a;

typedef pair<int, int> P;
map<int, int> dict_r[100000];
map<int, int> dict_c[100000];
map<int, int>::iterator it, it2;

bool solveH(int pre) {
	for (int i = 0; i < h; i++) {
		if (i == pre) continue;
		
		//i行目, pre行目を見て、[i][j]にも[pre][j]にも値があるようなjを列挙→固定値を求める
		int pnum = -1145141919;
		for (it = dict_r[pre].begin(); it != dict_r[pre].end(); it++) {
			//[pre][(*it).first]が存在するか？
			if (dict_r[i].find((*it).first) != dict_r[i].end()) {
				int num = dict_r[pre][(*it).first] - dict_r[i][(*it).first];
				if (pnum >= 0 && pnum != num) { return false; }
				pnum = num;
			}
		}
		if (pnum != -1145141919) {
			for (it = dict_r[pre].begin(); it != dict_r[pre].end(); it++) {
				if ((*it).second - pnum < 0) { return false; }
			}
			for (it = dict_r[i].begin(); it != dict_r[i].end(); it++) {
				if ((*it).second + pnum < 0) { return false; }
			}
		}
	}
	return true;
}

bool solveW(int pre) {
	for (int i = 0; i < w; i++) {
		if (i == pre) continue;
		
		//i列目, pre列目を見て、[j][i]にも[j][pre]にも値があるようなjを列挙→固定値を求める
		int pnum = -1145141919;
		for (it = dict_c[pre].begin(); it != dict_c[pre].end(); it++) {
			//[pre][(*it).first]が存在するか？
			if (dict_c[i].find((*it).first) != dict_c[i].end()) {
				int num = dict_c[pre][(*it).first] - dict_c[i][(*it).first];
				if (pnum >= 0 && pnum != num) { return false; }
				pnum = num;
			}
		}
		if (pnum != -1145141919) {
			for (it = dict_c[pre].begin(); it != dict_c[pre].end(); it++) {
				if ((*it).second - pnum < 0) { return false; }
			}
			for (it = dict_c[i].begin(); it != dict_c[i].end(); it++) {
				if ((*it).second + pnum < 0) { return false; }
			}
		}
	}
	return true;
}

signed main() {
	int i;
	
	cin >> h >> w;
	cin >> n;
	
	static int cnt_r[100000] = {0};
	static int cnt_c[100000] = {0};
	
	for (i = 0; i < n; i++) {
		cin >> r >> c >> a;
		r--; c--;
		dict_r[r].insert(P(c, a));
		dict_c[c].insert(P(r, a));
		cnt_r[r]++;
		cnt_c[c]++;
	}
	
	for (i = 0; i < h; i++) { if (cnt_r[i] * h <= n) break; }
	if (!solveH(i)) { cout << "No" << endl; return 0; }
	for (i = 0; i < w; i++) { if (cnt_c[i] * w <= n) break; }
	if (!solveW(i)) { cout << "No" << endl; return 0; }
	assert(0);
	cout << "Yes" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:9: error: 'assert' was not declared in this scope
   89 |         assert(0);
      |         ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <map>
  +++ |+#include <cassert>
    3 | #define int long long
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

typedef pair<int,int> pii;
typedef pair<int,pii> piii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)

struct edge{int to,cost;};
struct st{int pos,num;};
#define MAX_V 100000
int r,c;

vector<edge> G[100000];

int f=false;



void dfs(int cur, int d[MAX_V],map<piii,bool> &used){
	for(auto &e : G[cur]){
		int from=cur, to=e.to;
		if( used.count(make_pair( from,pii(to,e.cost) ))==0 ){
			used[make_pair( from,pii(to,e.cost) )]=true;
			if(d[to]==INF){
				d[to] = d[cur]+e.cost;
				if()
				dfs(to,d,used);
			}else {
				if(d[to] != d[cur]+e.cost)f=true;
			}
		}
	}
}


void solve(vector<pii> inp[100000]){
	rep(i,r)sort(all(inp[i]));
	
	vector<int> less(MAX_V,INF);
	rep(i,r){
		rep(j,inp[i].size()-1){
			int from = inp[i][j].first;
			int to = inp[i][j+1].first;
			less[from] = min(less[from],inp[i][j].second);
			if(j==inp[i].size()-1)	less[from] = min(less[from],inp[i][j].second);
			G[from].pb(edge{to  ,inp[i][j+1].second-inp[i][j].second});
			G[to  ].pb(edge{from,-(inp[i][j+1].second-inp[i][j].second)});
		}
	}

	int d[MAX_V];
	map<piii,bool> used;
	rep(i,MAX_V)d[i] = INF;
	rep(i,MAX_V){
		if(d[i]==INF){
			dfs((int)i,d,used);
		}
	}
}




int main(){
	cin>>r>>c;
	int n;
	cin>>n;
	vector<pii> inpy[MAX_V];
	vector<pii> inpx[MAX_V];
	rep(i,n){
		int y,x,a;
		cin>>y>>x>>a;
		y--,x--;
		inpy[y].pb(pii(x,a));
		inpx[x].pb(pii(y,a));
	}
	
	
	
	solve(inpy);
	rep(i,r)G[i].clear();
	solve(inpx);
	
	if(f)cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	
	
	
	
	
}

Compiler output:
a.cc: In function 'void dfs(int, int*, std::map<std::pair<int, std::pair<int, int> >, bool>&)':
a.cc:31:36: error: expected primary-expression before ')' token
   31 |                                 if()
      |                                    ^
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

typedef long long ll;


int main(){

  int r,c;
  int n;
  scanf("%d %d",&r ,&c);
  int t[r][c];
  rep(i,r){
    rep(j,c){
      t[i][j]=-1;
    }
  }

  scanf("%d", &n);
  
  rep(i,n){
    int rr,cc,a;
    scanf("%d", &rr);
    scanf("%d", &cc);
    scanf("%d", &a);
    t[rr-1][cc-1] = a;
  }
//  ll mm=0;
  int a=0;
    rep(i,r-1){
      rep(j,c-1){
	if(t[i][j]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j]=t[i+1][j]+t[i][j+1]-t[i+1][j+1];
	  if(t[i][j]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j]==-1&&t[i][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i+1][j]= t[i][j]-t[i][j+1]+t[i+1][j+1];
	  if(t[i+1][j]<0){printf("No\n");return 0;}
	}
	else if(t[i][j+1]==-1&&t[i+1][j]!=-1&&t[i][j]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j+1]= -t[i+1][j]+t[i][j]+t[i+1][j+1];
	  if(t[i][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  t[i+1][j+1]=t[i+1][j]+t[i][j+1]-t[i][j];
	  if(t[i+1][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]!=-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  if((t[i+1][j+1]+t[i][j])!=(t[i][j+1]+t[i+1][j])){printf("No\n");return 0;}
	}
	//if(mm>10000000){printf("Yes\n"); return 0;}
      }
    }

  printf("Yes\n");

  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:79:12: error: expected '}' at end of input
   79 |   return 0;
      |            ^
a.cc:29:11: note: to match this '{'
   29 | int main(){
      |           ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>


int main()
{
    srand(time(0));


    int R, C, N;
    scanf("%d%d%d", &R, &C, &N);

    int r, c, a;
    for( int i = 0; i < N; ++i ){
        scanf("%d%d%d", &r, &c, &n);
    }


    if( rand() & 1 ) printf("Yes\n");
    else printf("No\n");


    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:34: error: 'n' undeclared (first use in this function)
   16 |         scanf("%d%d%d", &r, &c, &n);
      |                                  ^
main.c:16:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostAream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

typedef long long ll;


int main(){

  int r,c;
  int n;
  scanf("%d %d",&r ,&c);
  int t[r][c];
  rep(i,r){
    rep(j,c){
      t[i][j]=-1;
    }
  }

  scanf("%d", &n);
  
  rep(i,n){
    int rr,cc,a;
    scanf("%d", &rr);
    scanf("%d", &cc);
    scanf("%d", &a);
    t[rr-1][cc-1] = a;
  }
  ll mm=0;
  int a=0;
    rep(i,r-1){
      rep(j,c-1){
	if(t[i][j]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j]=t[i+1][j]+t[i][j+1]-t[i+1][j+1];
	  if(t[i][j]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j]==-1&&t[i][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i+1][j]= t[i][j]-t[i][j+1]+t[i+1][j+1];
	  if(t[i+1][j]<0){printf("No\n");return 0;}
	}
	else if(t[i][j+1]==-1&&t[i+1][j]!=-1&&t[i][j]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j+1]= -t[i+1][j]+t[i][j]+t[i+1][j+1];
	  if(t[i][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  t[i+1][j+1]=t[i+1][j]+t[i][j+1]-t[i][j];
	  if(t[i+1][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]!=-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  if((t[i+1][j+1]+t[i][j])!=(t[i][j+1]+t[i+1][j])){printf("No\n");return 0;}
	}
	if(mm>10000000){printf("Yes\n"); return 0;}
      }
    }

  printf("Yes\n");

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: iostAream: No such file or directory
    1 | #include <iostAream>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>




using namespace std;


int main()
{
    srand(time(0));

    int R, C, N;
    scanf("%d%d%d", &R, &C, &N);

    int r, c, a;
    for( int i = 0; i < N; ++i ){
        scanf("%d%d%d", &r, &c, &n);
    }

    if( rand() & 1 ) printf("Yes\n");
    else printf("No\n");



    return 0;
}

Compiler output:
main.c:8:1: error: unknown type name 'using'
    8 | using namespace std;
      | ^~~~~
main.c:8:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    8 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:20:34: error: 'n' undeclared (first use in this function)
   20 |         scanf("%d%d%d", &r, &c, &n);
      |                                  ^
main.c:20:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#!/usr/bin/ruby
$m=Hash.new{|h,k|h[k]=[]}
$memo={}
def dfs(now,goal,d)
	v=$m[now]
	v.size.times{|i|
		if v[i][0]==goal&&v[i][1]!=d
			return false
		end
		if !$memo.has_key?(v[i][0])
			$memo[v[i][0]]=1
			if !dfs(v[i][0],goal,d-v[i][1])
				return false
			end
		end
	}
	return true
end

r,c=gets.split.map(&:to_i)
h=Hash.new{|h,k|h[k]=[]}
w=Hash.new{|h,k|h[k]=[]}
g=Hash.new{|h,k|h[k]=Hash.new{|h_,k_|h_[k_]=[]}}
a=[]
gets.to_i.times{
	x,y,z=gets.split.map(&:to_i)
	x-=1
	y-=1
	a<<[x,y,z]
	g[x][y]=z
	h[x]<<[y,z]
	w[y]<<[x,z]
}
h.each{|k,v|
	y0=v[0][0]
	v.each{|y,z|
		$memo={}
		d=g[k][y0]-g[k][y]
		if !dfs(y0,y,d)
			puts 'No'
			exit
		end
		$m[y0]<<[y,d]
		$m[y]<<[y0,-d]
	}
}
$m=Hash.new{|h,k|h[k]=[]}
w.each{|k,v|
	x0=v[0][0]
	v.each{|x,z|
		$memo={}
		d=g[x0][k]-g[x][k]
		if !dfs(x0,x,d)
			puts 'No'
			exit
		end
		$m[x0]<<[x,d]
		$m[x]<<[x0,-d]
	}
}
puts 'Yes'


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/ruby
      |  ^
a.cc:40:30: warning: multi-character character constant [-Wmultichar]
   40 |                         puts 'No'
      |                              ^~~~
a.cc:54:30: warning: multi-character character constant [-Wmultichar]
   54 |                         puts 'No'
      |                              ^~~~
a.cc:61:6: warning: multi-character character constant [-Wmultichar]
   61 | puts 'Yes'
      |      ^~~~~
a.cc:2:1: error: '$m' does not name a type
    2 | $m=Hash.new{|h,k|h[k]=[]}
      | ^~
a.cc:3:1: error: '$memo' does not name a type
    3 | $memo={}
      | ^~~~~
a.cc:4:1: error: 'def' does not name a type
    4 | def dfs(now,goal,d)
      | ^~~
a.cc:17:9: error: expected unqualified-id before 'return'
   17 |         return true
      |         ^~~~~~
a.cc:22:1: error: 'w' does not name a type
   22 | w=Hash.new{|h,k|h[k]=[]}
      | ^
a.cc:23:1: error: 'g' does not name a type
   23 | g=Hash.new{|h,k|h[k]=Hash.new{|h_,k_|h_[k_]=[]}}
      | ^
a.cc:24:1: error: 'a' does not name a type
   24 | a=[]
      | ^
a.cc:34:1: error: 'h' does not name a type
   34 | h.each{|k,v|
      | ^
a.cc:47:1: error: '$m' does not name a type
   47 | $m=Hash.new{|h,k|h[k]=[]}
      | ^~
a.cc:48:1: error: 'w' does not name a type
   48 | w.each{|k,v|
      | ^
a.cc:61:1: error: 'puts' does not name a type
   61 | puts 'Yes'
      | ^~~~
Language: C++

#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <random>
 
using namespace std;

random_device rnd(2,0);
int R;
int C;
int N;
 
 
int rs;
int cs;
int as;
bool dame=false;
 
int main(){
	scanf("%d %d %d",&R,&C,&N);
	
	vector< vector<int> > D(C, vector<int>(R, -1)); 
	
	for(int i=0;i<R;i++){
		for(int j=0;j<C;j++){
			D[i][j]=-1;
		}
	}
	
	for(int i=0;i<N;i++){
		scanf("%d %d %d",&rs,&cs,&as);
		//D[rs-1][cs-1]=as;
	}
	if(rnd()>1)cout<<"Yes";
	else cout<<"No";
	
	
	return 0;
}

Compiler output:
a.cc:9:22: error: no matching function for call to 'std::random_device::random_device(int, int)'
    9 | random_device rnd(2,0);
      |                      ^
In file included from /usr/include/c++/14/random:48,
                 from a.cc:5:
/usr/include/c++/14/bits/random.h:1763:5: note: candidate: 'std::random_device::random_device(const std::string&)'
 1763 |     random_device(const std::string& __token) { _M_init(__token); }
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:1763:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/random.h:1760:5: note: candidate: 'std::random_device::random_device()'
 1760 |     random_device() { _M_init("default"); }
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:1760:5: note:   candidate expects 0 arguments, 2 provided
Language: C++

#include <iostream>

using namespace std;

long long map[100000][100000];

int main(){
  int R,C;
  int N;
  int black=0;
  int white=0;
  cin >> R >> C;
  cin >> N;
  for(int i=0;i<N;i++){
    int r,c;
    cin >> r >> c;
    cin >> map[r][c];
  for(int i=0;i<R-1;i++){
    for(int j=0;j<C-1;j++){
      if(map[i][j]+map[i+1][j+1] != map[i+1][j]+map[i][j+1])
        cout << "No" << endl;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring> 
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
 
using namespace std;

#define mod 1000000007

int main()
{
    int r, c, n;
    cin >> r >> c >> n;
    vector<pair<int, int> > retsu[100001], gyou[100001];
    for(int i = 0; i < n; i++){
        int r, c, a;
        cin >> r >> c >> a;
        retsu[r].push_back(make_pair(c, a));
        gyou[c].push_back(make_pair(r, a));
    }
    double retsusub = mod + 0.0, gyousub = mod + 0.0, retsufirst[10001], gyoufirst[10001];
    for(int i = 1; i <= r; i++){
        if(retsu[i].size() == 0) continue;
        retsufirst[i] = mod;
        sort(retsu[i].begin(), retsu[i].end());
        for(int j = 1; j < retsu[i].size(); j++){
            double tmp = (double)(retsu[i][j].second - retsu[i][j - 1].second) / (retsu[i][j].first - retsu[i][j - 1].first);
            if(retsusub == mod){
                retsusub = tmp;
                
            }
            if(retsusub != tmp || floor(retsusub) != retsusub){
                cout << "No" << endl;
                return 0;
            }
        }
        if(retsu[i].size() > 0){
            retsufirst[i] = retsu[i][0].second - (retsusub * retsu[i][0].first - 1);
            if(retsufirst[i] + retsusub * (r - 1) < 0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    for(int i = 1; i <= c; i++){
        // cout << i << endl;
        if(gyou.size() == 0) continue;
        gyoufirst[i] = mod;
        sort(gyou[i].begin(), gyou[i].end());
        for(int j = 1; j < gyou[i].size(); j++){
            double tmp = (double)(gyou[i][j].second - gyou[i][j - 1].second) / (gyou[i][j].first - gyou[i][j - 1].first);
            // cout << tmp << endl;
            if(gyousub == mod){
                // cout << "ho" << endl;
                gyousub = tmp;
            }
            // cout << gyousub << endl;
            if(gyousub != tmp || floor(gyousub) != gyousub){
                cout << "No" << endl;
                return 0;
            }
        }
        if(gyou[i].size() > 0){
            gyoufirst[i] = gyou[i][0].second - (gyousub * gyou[i][0].first - 1);
            if(gyoufirst[i] + gyousub * (c - 1) < 0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    // cout << retsusub << " " << gyousub << endl;
    // cout << gyoufirst << " " << retsufirst << endl;
    if(gyoufirst[1] != mod && retsufirst[1] != mod && gyoufirst[1] != retsufirst[1]) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:17: error: request for member 'size' in 'gyou', which is of non-class type 'std::vector<std::pair<int, int> > [100001]'
   60 |         if(gyou.size() == 0) continue;
      |                 ^~~~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

typedef long long ll;


int main(){

  int r,c;
  int n;
  scanf("%d %d",&r ,&c);
  int t[r][c];
  rep(i,r){
    rep(j,c){
      t[i][j]=-1;
    }
  }

  scanf("%d", &n);
  
  rep(i,n){
    int rr,cc,a;
    scanf("%d", &rr);
    scanf("%d", &cc);
    scanf("%d", &a);
    t[rr-1][cc-1] = a;
  }
  int t=0;
  int a=0;
    rep(i,r-1){
      rep(j,c-1){
	if(t[i][j]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j]=t[i+1][j]+t[i][j+1]-t[i+1][j+1];
	  if(t[i][j]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j]==-1&&t[i][j]!=-1&&t[i][j+1]!=-1&&t[i+1][j+1]!=-1){
	  t[i+1][j]= t[i][j]-t[i][j+1]+t[i+1][j+1];
	  if(t[i+1][j]<0){printf("No\n");return 0;}
	}
	else if(t[i][j+1]==-1&&t[i+1][j]!=-1&&t[i][j]!=-1&&t[i+1][j+1]!=-1){
	  t[i][j+1]= -t[i+1][j]+t[i][j]+t[i+1][j+1];
	  if(t[i][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]==-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  t[i+1][j+1]=t[i+1][j]+t[i][j+1]-t[i][j];
	  if(t[i+1][j+1]<0){printf("No\n");return 0;}
	}
	else if(t[i+1][j+1]!=-1&&t[i+1][j]!=-1&&t[i][j+1]!=-1&&t[i][j]!=-1){
	  if((t[i+1][j+1]+t[i][j])!=(t[i][j+1]+t[i+1][j])){printf("No\n");return 0;}
	}
     if(t++>10000000){printf("Yes\n"); return 0;}
      }
    }

  printf("Yes\n");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:7: error: conflicting declaration 'int t'
   50 |   int t=0;
      |       ^
a.cc:34:7: note: previous declaration as 'int t [r][c]'
   34 |   int t[r][c];
      |       ^
a.cc:73:9: error: lvalue required as increment operand
   73 |      if(t++>10000000){printf("Yes\n"); return 0;}
      |         ^
Language: C++

#include <iostream>
#include <cstring>
#include <random>

using namespace std;

int map[100001][100001];
int main() {
  memset(map, -1, (unsigned long long)100001 * (unsigned long long)100001);

  int R, C, N;

  cin >> R >> C >> N;

  for(int i = 0; i < N; i++) {
    int r, c, a;
    cin >> r >> c >> a;
    map[r - 1][c - 1] = a;
  }

  bool flag = true;
  for(int i = 0; i < R; i++) {
    for(int j = 0; j < C; j++) {
      if(map[i][j] == -1) continue;

      int n = i + 1;
      while(n < R) {
        if(map[n][j] != -1) break;
        n++;
      }
      if(map[n][j] == -1) continue;

      int m = j + 1;
      while(m < C) {
        if(map[i][m] != -1) break;
        m++;
      }
      if(map[i][m] == -1) break;

      if(map[n][m] == -1) {
        map[n][m] = map[n][j] + map[i][m] - map[i][j];
        if(map[n][m] < 0) {
          flag = false;
          break;
        }
        else {
          if(map[n][m] != map[n][j] + map[i][m] - map[i][j]) {
            flag = false;
            break;
          }
        }
      }
    }
    if(!flag) break;
  }

  if(flag) {
    random_device rnd();
    if(rnd() % 2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:22: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   58 |     random_device rnd();
      |                      ^~
a.cc:58:22: note: remove parentheses to default-initialize a variable
   58 |     random_device rnd();
      |                      ^~
      |                      --
a.cc:58:22: note: or replace parentheses with braces to value-initialize a variable
a.cc:59:14: error: no match for 'operator%' (operand types are 'std::random_device' and 'int')
   59 |     if(rnd() % 2) {
      |        ~~~~~ ^ ~
      |           |    |
      |           |    int
      |           std::random_device
Language: C++

#include <iostream>
#include <cstring>
#include <random>

using namespace std;

int map[100001][100001];
int main() {
  //memset(map, -1, 100001 * 100001);

  int R, C, N;

  cin >> R >> C >> N;

  for(int i = 0; i < N; i++) {
    int r, c, a;
    cin >> r >> c >> a;
    map[r - 1][c - 1] = a;
  }

  bool flag = true;
  for(int i = 0; i < R; i++) {
    for(int j = 0; j < C; j++) {
      if(map[i][j] == -1) continue;

      int n = i + 1;
      while(n < R) {
        if(map[n][j] != -1) break;
        n++;
      }
      if(map[n][j] == -1) continue;

      int m = j + 1;
      while(m < C) {
        if(map[i][m] != -1) break;
        m++;
      }
      if(map[i][m] == -1) break;

      if(map[n][m] == -1) {
        map[n][m] = map[n][j] + map[i][m] - map[i][j];
        if(map[n][m] < 0) {
          flag = false;
          break;
        }
        else {
          if(map[n][m] != map[n][j] + map[i][m] - map[i][j]) {
            flag = false;
            break;
          }
        }
      }
    }
    if(!flag) break;
  }

  if(flag) {
    random_device rnd();
    if(rnd() % 2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:22: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   58 |     random_device rnd();
      |                      ^~
a.cc:58:22: note: remove parentheses to default-initialize a variable
   58 |     random_device rnd();
      |                      ^~
      |                      --
a.cc:58:22: note: or replace parentheses with braces to value-initialize a variable
a.cc:59:14: error: no match for 'operator%' (operand types are 'std::random_device' and 'int')
   59 |     if(rnd() % 2) {
      |        ~~~~~ ^ ~
      |           |    |
      |           |    int
      |           std::random_device
Language: C++

#include <iostream>
#include <random>

using namespace std;

int map[100001][100001];
int main() {
  memset(map, -1, 100001 * 100001);

  int R, C, N;

  cin >> R >> C >> N;

  for(int i = 0; i < N; i++) {
    int r, c, a;
    cin >> r >> c >> a;
    map[r - 1][c - 1] = a;
  }

  bool flag = true;
  for(int i = 0; i < R; i++) {
    for(int j = 0; j < C; j++) {
      if(map[i][j] == -1) continue;

      int n = i + 1;
      while(n < R) {
        if(map[n][j] != -1) break;
        n++;
      }
      if(map[n][j] == -1) continue;

      int m = j + 1;
      while(m < C) {
        if(map[i][m] != -1) break;
        m++;
      }
      if(map[i][m] == -1) continue;

      if(map[n][m] == -1) {
        map[n][m] = map[n][j] + map[i][m] - map[i][j];
        if(map[n][m] < 0) {
          flag = false;
          break;
        }
        else {
          if(map[n][m] != map[n][j] + map[i][m] - map[i][j]) {
            flag = false;
            break;
          }
        }
      }
    }
    if(!flag) break;
  }

  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: warning: integer overflow in expression of type 'int' results in '1410265409' [-Woverflow]
    8 |   memset(map, -1, 100001 * 100001);
      |                   ~~~~~~~^~~~~~~~
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(map, -1, 100001 * 100001);
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <random>
  +++ |+#include <cstring>
    3 |
Language: C

#include<stdio.h>

#define RMAX 100001
#define CMAX 100001
#define NMAX 100000

unsigned long a[RMAX][CMAX], isfilled[RMAX][CMAX];
int r[NMAX], c[NMAX];

int main(void){
    long i, j;
    
    long R, C, N, anow;
    
    
    scanf("%ld", &R);
    scanf("%ld", &C);
    scanf("%ld", &N);
    
    for(i = 0; i < N; i++){
        scanf("%ld", &(r[i]));
        scanf("%ld", &(c[i]));
        scanf("%ld", &anow);
        a[r[i]][c[i]] = anow;
        isfilled[r[i]][c[i]] = 1;
    }
    
    for(i = 0; i < N - 1; i++){
        for(j = i + 1; j < N; j++){
            if(r[i] == r[j] || c[i] == c[j]) continue;
            switch(isfilled[r[i]][c[i]] + isfilled[r[i]][c[j]] + isfilled[r[j]][c[i]] + isfilled[r[j]][c[j]]){
                case 4:
                    if(a[r[i]][c[i]] + a[r[j]][c[j]] != a[r[j]][c[i]] + a[r[i]][c[j]]) goto no;
                    break;
                
                case 3:
                    if(!isfilled[r[i]][c[i]] || !isfilled[r[j]][c[j]]){
                        if(a[r[i]][c[i]] + a[r[j]][c[j]] > a[r[j]][c[i]] + a[r[i]][c[j]]) goto no;
                    }else{
                        if(a[r[i]][c[i]] + a[r[j]][c[j]] < a[r[j]][c[i]] + a[r[i]][c[j]]) goto no;
                    }
                    break;
            }
        }
    }
    
    if(1){
        printf("Yes");
    }else{
        no: printf("No");
    }
    
    return 0;
}

Compiler output:
/tmp/ccucahyJ.o: in function `main':
main.c:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0xa2): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0xee): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x104): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x13f): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x155): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x176): relocation truncated to fit: R_X86_64_PC32 against symbol `isfilled' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x1d8): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x1f6): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccucahyJ.o
main.c:(.text+0x20c): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

const string YES = "Yes";
const string NO  = "No";

struct Data {
  int x,y;
  bool operator < ( const Data& data ) const {
    if( x != data.x ) return x < data.x;
    return y < data.y;
  }
  bool operator == (const Data& data) const {
    return x == data.x && y == data.y;
  }
};

int H,W,N;

int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

inline bool isValid(int x,int y) { return 0 <= x && x < W && 0 <= y && y < H; }

bool check(map<Data,int> &mp,int x,int y,int a) {
  rep(i,4) {
    int x2 = x + dx[i] * 2 , y2 = y + dy[i] * 2;
    if( !isValid(x2,y2) ) continue;
    int x3 = x + dx[(i+1)%4] * 2, y3 = y + dy[(i+1)%4] * 2;
    if( !isValid(x3,y3) ) continue;
    if( !mp.count((Data){x2,y2}) ) continue;
    if( !mp.count((Data){x3,y3}) ) continue;
    int x4 = x + dx[i] * 2 + dx[(i+1)%4] * 2;
    int y4 = y + dy[i] * 2 + dy[(i+1)%4] * 2;
    if( mp.count((Data){x4,y4}) ) {
      int a2 = mp[(Data){x4,y4}];
      if( ( a + a2 ) != ( mp[(Data){x2,y2}] + mp[(Data){x3,y3}] ) ) return false;
    }
  }
  return true;
}

int main(){
  scanf(" %d %d",&H,&W);
  scanf(" %d",&N);
  map<Data,int> mp;
  rep(i,N) {
    int x,y,a;
    scanf(" %d %d %d",&y,&x,&a);
    --x, --y;
    mp[(Data){x,y}] = a;
  }
  bool update = true;
  int cnt = 0;
  while( update ) {
    ++cnt;
    if( cnt >= 100 ) { cout << NO << endl; return 0: }
    update = false;
    map<Data,int> next;
    for(map<Data,int>::iterator it = mp.begin();it!=mp.end();++it) {
      int x = (it->first).x;
      int y = (it->first).y;
      int a = it->second;
      if( !check(mp,x,y,a) ) {
	cout << NO << endl;
	return 0;
      }
      //cout << x << "," << y << " = " << a <<endl;
      rep(i,4) {
	int x2 = x + dx[i], y2 = y + dy[i];
	if( !isValid(x2,y2) ) continue;
	int x3 = x + dx[(i+1)%4], y3 = y + dy[(i+1)%4];
	if( !isValid(x3,y3) ) continue;
	if( !mp.count((Data){x2,y2}) ) continue;
	if( !mp.count((Data){x3,y3}) ) continue;
	int x4 = x + dx[i] + dx[(i+1)%4];
	int y4 = y + dy[i] + dy[(i+1)%4];
	if( mp.count((Data){x4,y4}) ) {
	  int v1 = a + mp[(Data){x4,y4}];
	  int v2 = mp[(Data){x2,y2}] + mp[(Data){x3,y3}];
	  if( v1 != v2 ) {
	    cout << NO << endl;
	    return 0;
	  }
	} else {
	  int v1 = a;
	  int v2 = mp[(Data){x2,y2}] + mp[(Data){x3,y3}];
	  if( v2 - v1 < 0 ) {
	    cout << NO << endl;
	    return 0;
	  }
	  next[(Data){x4,y4}] = v2 - v1;
	  update = true;
	}
      }
      if( update ) break;
    }


    for(map<Data,int>::iterator it = next.begin();it!=next.end();++it) {
      int x = (it->first).x;
      int y = (it->first).y;
      int a = it->second;
      mp[(Data){x,y}] = a;
    }

  }
  cout << YES << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:52: error: expected ';' before ':' token
   61 |     if( cnt >= 100 ) { cout << NO << endl; return 0: }
      |                                                    ^
      |                                                    ;
a.cc:61:52: error: expected primary-expression before ':' token
Language: C++

/*
 * Created by KeigoOgawa
 */


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <cmath>

typedef long long ll;
#define INF (int)1e10
#define EPS 1e-10
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define debug(x) cout << #x << ": " << x << endl
#define all(a) (a).begin(), (a).end()

using namespace std;
typedef unsigned long long ull;
typedef pair<int, int> PII;

int R, C, N;
int a[100000][100000] = {INF};

bool check() {
  REP(i, C - 1) {
    REP(j, R - 1) {
      int lu = a[i][j], ld = a[i + 1][j], ru = a[i][j + 1], rd = a[i + 1][j + 1];
      if (lu < INF && ld < INF && ru < INF && rd < INF) {
        if (lu + rd != ld + ru || lu < 0 || rd < 0 || ld < 0 || ru < 0) {
          return false;
        }
      }
    }
  }
  return true;
}


bool ume3() {
  REP(i, C - 1) {
    REP(j, R - 1) {
      int lu = a[i][j], ld = a[i + 1][j], ru = a[i][j + 1], rd = a[i + 1][j + 1];
      if (lu == INF && ld < INF && ru < INF && rd < INF) {
        lu = (ru + ld) - rd;
        if (lu < 0) return false;
        a[i][j] = lu;
      }
      if (lu < INF && ld == INF && ru < INF && rd < INF) {
        ld = (lu + rd) - ru;
        if (ld < 0) return false;
        a[i + 1][j] = ld;
      }
      if (lu < INF && ld < INF && ru == INF && rd < INF) {
        ru = (lu + rd) - ld;
        if (ru < 0) return false;
        a[i][j+1] = ru;
      }
      if (lu < INF && ld < INF && ru < INF && rd == INF) {
        rd = (ru + ld) - lu;
        if (rd < 0) return false;
        a[i + 1][j + 1] = rd;
      }
    }
  }
  return true;
}

void solve() {
  // 4 kakunin
  if (!check()) {
    cout << "No" << endl;
    return;
  }

  // 3 ume
  if (!ume3()) {
    cout << "No" << endl;
    return;
  }
  if (!check()) {
    cout << "No" << endl;
    return;
  }


  cout << "Yes" << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> R >> C >> N;
  REP(i, N) {
    ll r, c, aa;
    cin >> r >> c >> aa;
    r--;
    c--;
    a[r][c] = aa;
  }
  solve();
  return 0;
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++

/*
 * Created by KeigoOgawa
 */


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <cmath>

typedef long long ll;
#define INF (ll)1e10
#define EPS 1e-10
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define debug(x) cout << #x << ": " << x << endl
#define all(a) (a).begin(), (a).end()

using namespace std;
typedef unsigned long long ull;
typedef pair<int, int> PII;

ll R, C, N;
ll a[100000][100000] = {INF};

bool check() {
  REP(i, C - 1) {
    REP(j, R - 1) {
      int lu = a[i][j], ld = a[i + 1][j], ru = a[i][j + 1], rd = a[i + 1][j + 1];
      if (lu < INF && ld < INF && ru < INF && rd < INF) {
        if (lu + rd != ld + ru || lu < 0 || rd < 0 || ld < 0 || ru < 0) {
          return false;
        }
      }
    }
  }
  return true;
}


bool ume3() {
  REP(i, C - 1) {
    REP(j, R - 1) {
      ll lu = a[i][j], ld = a[i + 1][j], ru = a[i][j + 1], rd = a[i + 1][j + 1];
      if (lu == INF && ld < INF && ru < INF && rd < INF) {
        lu = (ru + ld) - rd;
        if (lu < 0) return false;
        a[i][j] = lu;
      }
      if (lu < INF && ld == INF && ru < INF && rd < INF) {
        ld = (lu + rd) - ru;
        if (ld < 0) return false;
        a[i + 1][j] = ld;
      }
      if (lu < INF && ld < INF && ru == INF && rd < INF) {
        ru = (lu + rd) - ld;
        if (ru < 0) return false;
        a[i][j+1] = ru;
      }
      if (lu < INF && ld < INF && ru < INF && rd == INF) {
        rd = (ru + ld) - lu;
        if (rd < 0) return false;
        a[i + 1][j + 1] = rd;
      }
    }
  }
  return true;
}

void solve() {
  // 4 kakunin
  if (!check()) {
    cout << "No" << endl;
    return;
  }

  // 3 ume
  if (!ume3()) {
    cout << "No" << endl;
    return;
  }
  if (!check()) {
    cout << "No" << endl;
    return;
  }


  cout << "Yes" << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> R >> C >> N;
  REP(i, N) {
    ll r, c, aa;
    cin >> r >> c >> aa;
    r--;
    c--;
    a[r][c] = aa;
  }
  solve();
  return 0;
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.