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

#include <iostream>
#include <tuple>
#include <queue>
#include <algorithm>
using namespace std;
typedef tuple<int, int, int> tiii;
const int INF = 1 << 29;
int N, M,
int A[100][100];
int a, b, c;
queue<tiii> q;
int main(void) {
	cin >> N >> M;
	fill_n(A, N * N, INF);
	for (int i = 0; i < M; ++i) {
		cin >> a >> b >> c;
		--a; --b;
		A[a][b] = A[b][a] = c;
		q.push(tiii(a, b, c));
	}
	for (int k = 0; k < N; ++k) for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
	int ans = M;
	while (!q.empty()) {
		tie(a, b, c) = q.front(); q.pop();
		if (A[a][b] == c) --M;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:9:1: error: expected unqualified-id before 'int'
    9 | int A[100][100];
      | ^~~
a.cc: In function 'int main()':
a.cc:14:16: error: 'A' was not declared in this scope
   14 |         fill_n(A, N * N, INF);
      |                ^
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
#define int long long
#define str string
#define rep(i,j) for(int i=0;i<(int)(j);i++)
typedef long long ll;
typedef long double ld;
const ll inf = 999999999999999999;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct S {//辺の情報を入れる変数
	int from, to, cost;
};
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
int n, m;
int a[101][101];
S b[5000];
signed main() {
	cin >> n >> m;
	rep(i, 101)
		rep(j, 101)
		a[i][j] = inf;
	for (int i = 0; i <= 101; i++)
		a[i][i] = 0;
	for (int i = 0; i < m; i++) {
		cin >> b[i].from >> b[i].to >> b[i].cost;
		a[b[i].from][b[i].to] = b[i].cost;
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			for (int k = 1; k <= n; k++) {
				a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
				a[j][i] = a[i][j];
			}
		}
	}
	int sum = 0;
	for (int i = 0; i < m; i++) {
		bool l = 1;
		for (int j = 1; j <= n; j++) {
			if (a[b[i].from][j] + b[i].cost == a[b[i].to][j])
				l = 0;
			if (a[b[i].to] + b[i].cost == a[b[i].from][j])
				l = 0;
		}
		if (l)
			sum++;
	}
	cout << sum << endl;
	getchar(); getchar();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:52: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   69 |                         if (a[b[i].to] + b[i].cost == a[b[i].from][j])
      |                             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class Main2{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m];
		int[] b = new int[m];
		int[] c = new int[m];

		int[][] dist = new int[n][n];

		for(int i = 0; i < n; i++){
			for(int j =0; j<n; j++){
				if(i==j) dist[i][j] = 0;
				else dist[i][j] = (int)1e9;
			}
		}
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt()-1;
			b[i] = sc.nextInt()-1;
			c[i] = sc.nextInt();

			dist[a[i]][b[i]] = dist[b[i]][a[i]] = c[i];
		}

		for(int k=0; k<n; k++){
			for(int i=0; i<n; i++){
				for(int j=0; j<n; j++){
					dist[i][j] = Math.min(dist[i][k] + dist[k][j], dist[i][j]);
				}
			}
		}

		int count =0;
		for(int i=0; i<m; i++){
			if(c[i] > dist[a[i]][b[i]]) count++;
		}

		System.out.println(count);
	}
}

Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2{
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class <Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[][] edge = new int[m][3];
        int[][] cost = new int[n][n];
        ArrayList<Integer>[][] minEdgeList = new ArrayList[n][n];

        for (int i = 0; i < m; i++) {
            edge[i][0] = scanner.nextInt()-1;
            edge[i][1] = scanner.nextInt()-1;
            edge[i][2] = scanner.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                minEdgeList[i][j] = new ArrayList<>();
            }
            Arrays.fill(cost[i], Integer.MAX_VALUE);
        }

        for (int i = 0; i < n; i++) {
            cost[i][i] = 0;
        }

        // ベルマンフォード法？
        for (int startIndex = 0; startIndex < n; startIndex++) {
            while (true) {
                boolean isUpdated = false;
                for (int edgeIndex = 0; edgeIndex < m; edgeIndex++) {
                    int viaNode = edge[edgeIndex][0];
                    int targetNode = edge[edgeIndex][1];
                    int viaCost = edge[edgeIndex][2];
                    if (cost[startIndex][targetNode] > cost[startIndex][viaNode] + viaCost) {
                        isUpdated = true;
                        cost[startIndex][targetNode] = cost[startIndex][viaNode] + viaCost;
                        minEdgeList[startIndex][targetNode].clear();
                        minEdgeList[startIndex][targetNode].addAll(minEdgeList[startIndex][viaNode]);
                        minEdgeList[startIndex][targetNode].add(edgeIndex);
                    }
                    viaNode = edge[edgeIndex][1];
                    targetNode = edge[edgeIndex][0];
                    if (cost[startIndex][targetNode] > cost[startIndex][viaNode] + viaCost) {
                        isUpdated = true;
                        cost[startIndex][targetNode] = cost[startIndex][viaNode] + viaCost;
                        minEdgeList[startIndex][targetNode].clear();
                        minEdgeList[startIndex][targetNode].addAll(minEdgeList[startIndex][viaNode]);
                        minEdgeList[startIndex][targetNode].add(edgeIndex);
                    }
                }
                if(!isUpdated) {
                    break;
                }
            }
        }

        boolean[] used = new boolean[m];
        Arrays.fill(used, false);

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                for (int edgeIndex : minEdgeList[i][j]) {
                    used[edgeIndex] = true;
                }
            }
        }

        int ans = 0;
        for (boolean isUsed : used) {
            if (!isUsed) ans++;
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:5: error: <identifier> expected
public class <Main {
            ^
Main.java:5: error: > expected
public class <Main {
                  ^
2 errors
Language: C++

// kurikazu
#include<iostream>
#include<vector>
#include<queue>
#include<set>
// #include<unordered_set>
using namespace std;
typedef pair<int, int> pii;
int main(){
  int n, m;
  std::cin >> n >> m;
  vector<vector<pii> > g(n);
  set<pii> s;
  for (int i = 0; i < m; i++) {
    int a, b, c;
    std::cin >> a >> b >> c;
    a--, b--;
    g[a].push_back(pii(b, c));
    g[b].push_back(pii(a, c));
  }
  
  for (int i = 0; i < n; ++i) sort(g[i].begin(), g[i].end());
  priority_queue<pii, vector<pii>, greater<pii> > que;
 
  for (int i = 0; i < n; i++) {
    vector<int> cost(n, 1e9);
    vector<int> parent(n, -1);
    que.push(pii(0, i));
    while(not que.empty()){
      int v = que.top().second;
      int c = que.top().first;
      que.pop();
      for (int i = 0; i < g[v].size(); i++) {
        int to = g[v][i].first;
        if(cost[to] > c + g[v][i].second){
          cost[to] = c + g[v][i].second;
          que.push(pii(cost[to], to));
          parent[to] = v;
        }
      }
    }
    for (int j = 0; j < n; j++) {
      if(i == j)continue;
      s.insert(pii(j, parent[j]));
      s.insert(pii(parent[j], j));
    }
  }
  std::cout << m - s.size()/2 << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |   for (int i = 0; i < n; ++i) sort(g[i].begin(), g[i].end());
      |                               ^~~~
      |                               short
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>

int main() {
    int g[128][128]={};

    for (size_t i=0; i<128; ++i)
        for (size_t j=0; j<128; ++j)
            g[i][j] = 5e8;

    size_t N;
    int M;
    scanf("%zu %d", &N, &M);

    std::map<std::pair<size_t, size_t>, int> edges;
    std::vector<std::pair<size_t, size_t>> orig;
    for (int i=0; i<M; ++i) {
        size_t a, b;
        int c;
        scanf("%zu %zu %d", &a, &b, &c);
        --a, --b;
        g[a][b] = g[b][a] = c;

        edges[std::make_pair(a, b)] = 1;
        edges[std::make_pair(b, a)] = 1;

        if (a > b) std::swap(a, b);
        orig.emplace_back(a, b);
    }


    for (size_t k=0; k<N; ++k)
        for (size_t i=0; i<N; ++i)
            for (size_t j=0; j<N; ++j)
                if (g[i][j] > g[i][k] + g[k][j]) {
                    g[i][j] = g[i][k] + g[k][j];

                    --edges[std::make_pair(i, j)];
                    ++edges[std::make_pair(i, k)];
                    ++edges[std::make_pair(k, j)];
                }

    int cnt=0;
    for (const auto &e: orig)
        if (!edges[e] && !edges[std::make_pair(e.second, e.first)) ++cnt;

    printf("%d\n", cnt);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:66: error: expected ']' before ')' token
   48 |         if (!edges[e] && !edges[std::make_pair(e.second, e.first)) ++cnt;
      |                                                                  ^
      |                                                                  ]
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] a = new int[M];
    int[] b = new int[M];
    int[] c = new int[M];
    for(int i = 0; i < M; i++) {
      a[i] = sc.nextInt() - 1;
      b[i] = sc.nextInt() - 1;
      c[i] = sc.nextInt();
    }
    int[][] dp = new int[N][N];
    for(int i = 0; i < N; i++) {
      for(int j = 0; j < N; j++) {
        if(i != j) {
          dp[0][i][j] = Integer.MAX_VALUE;
        } else {
          dp[0][i][j] = 0;
        }
      }
    }
    for(int i = 0; i < M; i++) {
      dp[0][a[i]][b[i]] = c[i];
      dp[0][b[i]][a[i]] = c[i];
    }
    for(int k = 0; k < N; k++) {
      for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
          dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j]);
        }
      }
    }
    int ans = 0;
    for(int i = 0; i < M; i++) {
      if(dp[N][a[i]][b[i]] < c[i]) ans++;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:20: error: array required, but int found
          dp[0][i][j] = Integer.MAX_VALUE;
                  ^
Main.java:22: error: array required, but int found
          dp[0][i][j] = 0;
                  ^
Main.java:27: error: array required, but int found
      dp[0][a[i]][b[i]] = c[i];
                 ^
Main.java:28: error: array required, but int found
      dp[0][b[i]][a[i]] = c[i];
                 ^
Main.java:39: error: array required, but int found
      if(dp[N][a[i]][b[i]] < c[i]) ans++;
                    ^
5 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] a = new int[M];
    int[] b = new int[M];
    int[] c = new int[M];
    for(int i = 0; i < M; i++) {
      a[i] = sc.nextInt() - 1;
      b[i] = sc.nextInt() - 1;
      c[i] = sc.nextInt();
    }
    int[][][] dp = new int[N][N][N];
    for(int i = 0; i < N; i++) {
      for(int j = 0; j < N; j++) {
        if(i != j) {
          dp[0][i][j] = Integer.MAX_VALUE;
        } else {
          dp[0][i][j] = 0;
        }
      }
    }
    for(int i = 0; i < M; i++) {
      dp[0][a[i]][b[i]] = c[i];
      dp[0][b[i]][a[i]] = c[i];
    }
    for(int k = 0; k < N; k++) {
      for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
          dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j]);
        }
      }
    }
    int ans = 0;
    for(int i = 0; i < M; i++) {
      if(dp[N][a[i]][b[i]] < c[i]) ans++;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:33: error: bad operand types for binary operator '+'
          dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j]);
                                                 ^
  first type:  int[]
  second type: int[]
1 error
Language: C++

#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int n, m; cin >> n >> m; vector<vector<int>>d(n, vector<int>(n, INF));
	vector<int>a(m), b(m), c(m);
	rep(i, 0, n)d[i][i] = 0;
	rep(i, 0, m) {
		cin >> a[i] >> b[i] >> c[i];
		a[i]--; b[i]--;
		d[a[i]][b[i]] = min(d[a[i]][b[i]], c[i]);
		d[b[i]][a[i]] = min(d[b[i]][a[i]], c[i]);
	}
	rep(k, 0, n) {
		rep(i, 0, n) {
			rep(j, 0, n) {
				d[i][j] = min(d[i][j], d[i][k], d[k][j]);
			}
		}
	}
	int ans = m;
	rep(i, 0, m) {
		bool check = false;
		rep(j, 0, n) {
			if (d[j][a[i]] + c[i] == d[j][b[i]])check = true;
		}
		if (check)ans--;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:29:18:   required from here
   29 |                                 d[i][j] = min(d[i][j], d[i][k], d[k][j]);
      |                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main() {
    int a[1000], b[1000], c[1000];
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i] >> c[i];
    }

    for (int i = 0; i < m; i++) {
        a[i]--;
        b[i]--;
    }
    int d[100][128] = {};
    for (int i = 0; i < m; i++) {
        d[a[i]][b[i]] = d[b[i]][a[i]] = c[i];
    }

    int k = 0;
    for (int i = 0; i < m; i++) {
        int vl[100] = {};
        int v0[200][2] = { a[i], 0 }, u1 = 1, u2, f = 0;
        int (*v1)[2] = v0, (*v2)[2] = v0 + 100;
        vl[a[i]] = 1;
        for (;;) {
            memset(v2, 0, n * sizeof *v0);
            u2 = 0;
            for (int u = 0; u < u1; u++) {
                const int v3 = v1[u][0];
                const int d3 = v1[u][1];
                for (int v4 = 0; v4 < 100; v4++) {
                    if (vl[v4] || (f == 0 && v4 == b[i])) continue;
                    int d4 = d[v3][v4];
                    if (d4 == 0) continue;
                    d4 += d3;
                    if (d4 >= c[i]) continue;
                    v2[u2][0] = v4;
                    v2[u2][1] = d4;
                    vl[v4] = 1;
                    u2++;
                    if (v4 == b[i]) goto break3;
                }
            }
            if (u2 == 0) break;
            std::swap(v1, v2);
            std::swap(u1, u2);
            f = 1;
        }
        continue;
    break3:
        k++;
    }

    cout << k << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'memset' was not declared in this scope
   31 |             memset(v2, 0, n * sizeof *v0);
      |             ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdlib>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int g[101][101];
int es[101][101];
int main() {
	int N, M; cin >> N >> M;
	rep(i, N) rep(j, N) g[i][j] = 1 << 29;
	rep(i, M) {
		int a, b, c; cin >> a >> b >> c;
		a--; b--;
		es[a][b] = es[b][a] = g[a][b] = g[b][a] = c;
	}
	rep(k, N) rep(i, N) rep(j, N) g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
	rep(i, N) rep(j, i + 1, N) if (es[i][j] == g[i][j]) M--;
	cout << M << endl;
}

Compiler output:
a.cc:15:34: error: macro "rep" passed 3 arguments, but takes just 2
   15 |         rep(i, N) rep(j, i + 1, N) if (es[i][j] == g[i][j]) M--;
      |                                  ^
a.cc:3:9: note: macro "rep" defined here
    3 | #define rep(i, n) for (int i = 0; i < n; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:15:19: error: 'rep' was not declared in this scope
   15 |         rep(i, N) rep(j, i + 1, N) if (es[i][j] == g[i][j]) M--;
      |                   ^~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class CandidatesOfNoShortestPaths {
	static ArrayList[] gragh;
	static int n, m;
	static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);

		n = sc.nextInt();
		m = sc.nextInt();
		init();

		for(int i = 0;i < n;i++){
			dijkstra(i);
		}
		int count = 0;
		for(int i = 0;i < n;i++){
			for(int j = 0;j < gragh[i].size();j++){
				Ed edge = (Ed)gragh[j].get(j);
				if(!edge.used)count++;
			}
		}

		System.out.println(count/2);
	}

	static void dijkstra(int a) {// node aからの各nodeまでの最短を計算
		boolean used[] = new boolean[n];
		int shortest[] = new int[n];
		Ed myEdge[] = new Ed[n];
		for (int i = 0; i < n; i++) {
			shortest[i] = 999999999;
		}
		shortest[a] = 0;

		for (int i = 0; i < n; i++) {
			int next = 999999999;
			int nextN = a;
			for (int j = 0; j < n; j++) {
				if (!used[j] && shortest[j] < next) {
					next = shortest[j];
					nextN = j;
				}
			}
			used[nextN] = true;
			if(nextN != a){
				myEdge[nextN].used = true;
				for(int j = 0;j < gragh[nextN].size();j++){
					Ed e = (Ed)gragh[nextN].get(j);
					if(shortest[nextN]-e.cost == shortest[e.node]){
						e.used = true;
					}
				}
			}

			for (int j = 0; j < gragh[nextN].size(); j++) {
				Ed edge = (Ed) gragh[nextN].get(j);
				if (shortest[edge.node] > shortest[nextN] + edge.cost) {
					shortest[edge.node] = shortest[nextN] + edge.cost;
					myEdge[edge.node] = edge;
				}
			}
		}

		return;
	}

	static void init() {
		gragh = new ArrayList[n];

		for (int i = 0; i < n; i++) {
			gragh[i] = new ArrayList<Ed>();
		}

		for (int i = 0; i < m; i++) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			int c = sc.nextInt();

			gragh[a].add(new Ed(b, c));
			gragh[b].add(new Ed(a, c));
		}
	}
}

class Ed {
	int node;
	int cost;
	boolean used;

	Ed(int node, int cost) {
		this.node = node;
		this.cost = cost;
		used = false;
	}
}

Compiler output:
Main.java:4: error: class CandidatesOfNoShortestPaths is public, should be declared in a file named CandidatesOfNoShortestPaths.java
public class CandidatesOfNoShortestPaths {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v,n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vlint(v,n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v,n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v,n1,n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v,n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long int MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};



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

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

  	int a[100][100]={},b[100][100]={};

    REP(i, N)REP(j, N) if(i!=j)b[i][j]=1<<28;
  	REP(i, M)
  	{
  		int u,v,c;
  		std::cin>>u>>v>>c;u--,v--;
  		a[u][v]=a[v][u]=b[u][v]=b[v][u]=c;
  	}
  	REP(i, N)REP(j, N)REP(k, N)b[i][j]=std::min(b[i][j],b[i][k]+b[k][j]);
  	int c=0;
  	REP(i, N)REPS(j, i+1, N)if(a[i][j]>b[i][j])c++;
  	std::cout<<c<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:61:4: error: expected '}' at end of input
   61 |   }
      |    ^
a.cc:40:16: note: to match this '{'
   40 | int main(void) {
      |                ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

class Node{
public:
	vector<int> ecost;
	bool done;
	int cost;
	vector<int> wayid
	int from;
	void init(int n){ ecost.resize(n); wayid.resize(n); }
};
void find(bool *unused, Node *node, int i, int j, int n);
int main(){
	int n, m;
	cin >> n >> m;

	int a[m], b[m], c[m];

	int i, j;
	for(i=0; i<m; i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	Node node[n];
	for(i=0; i<n; i++){
		node[i].init(n);
	}
	for(i=0; i<n; i++){
		node[a[i]].ecost[b[i]] = c[i];
		node[b[i]].ecost[a[i]] = c[i];
		node[a[i]].wayid[b[i]] = i;
		node[b[i]].wayid[a[i]] = i;
	}
	bool unused[m];
	for(i=0; i<m; i++){
		unused[i]=1;
	}
//i...start, j...end
	int k;
	for(i=0; i<n; i++){
	for(j=0; j<n; j++){
		if(i>=j) continue;
		for(k=0; k<n; k++) { node.done=0; node.cost=-1; }
		find(unused, node, i, j, n);
	}
	}
	int a;
	for(i=0; i<n; i++){
		a+=unused[i];
	}
	cout << a << endl;
	return 0;
}


void find(bool *unused, Node *node, int s, int g, int n){
	int i , j, k;

	node[s].done=1;
	for(i=0; i<n; i++){
		if(node[s].ecost[i]){
			node[i].cost=node[s].ecost;
			node[i].from = s;
		}
	}
	while(1){
		for(i=0; i<n; i++){
			if(node[i].done) continue;
			if(node[i].cost <0) continue;
			k=0;
			for(j=0; j<n; j++){
				if(node[j].cost<0) { 
					node[j].cost=node[i].ecost[j];
					node[j].from=i;
					k=1;
					continue;
				}
				if(node[j].cost>node[i].ecost[j]+node[i].cost){
					node[j].cost=node[i].ecost[j]+node[i].cost;
					node[j].from=i;
					k=1;
					continue;
				}
			}
			if(k==0) node[i].done=1;
		}
		j=1;
		for(i=0; i<n; i++){
			j*=node[i].done;
		}
		if(j) break;
	}

	i=g;
	while(1){
		unused[node[i].wayid[node[i].from]] = 0;
		i=node[i].from;
		if(i==s) break;
	}
}

Compiler output:
a.cc:10:21: error: expected ';' at end of member declaration
   10 |         vector<int> wayid
      |                     ^~~~~
      |                          ;
a.cc: In function 'int main()':
a.cc:44:43: error: request for member 'done' in 'node', which is of non-class type 'Node [n]'
   44 |                 for(k=0; k<n; k++) { node.done=0; node.cost=-1; }
      |                                           ^~~~
a.cc:44:56: error: request for member 'cost' in 'node', which is of non-class type 'Node [n]'
   44 |                 for(k=0; k<n; k++) { node.done=0; node.cost=-1; }
      |                                                        ^~~~
a.cc:48:13: error: conflicting declaration 'int a'
   48 |         int a;
      |             ^
a.cc:19:13: note: previous declaration as 'int a [m]'
   19 |         int a[m], b[m], c[m];
      |             ^
a.cc:50:18: error: incompatible types in assignment of 'bool' to 'int [m]'
   50 |                 a+=unused[i];
      |                 ~^~~~~~~~~~~
a.cc: In function 'void find(bool*, Node*, int, int, int)':
a.cc:63:46: error: cannot convert 'std::vector<int>' to 'int' in assignment
   63 |                         node[i].cost=node[s].ecost;
      |                                      ~~~~~~~~^~~~~
      |                                              |
      |                                              std::vector<int>
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;

const int MAX_V = 100, INF = 999999;
static int cost[MAX_V][MAX_V];
static int edge[MAX_V][MAX_V];
static int d[MAX_V];
static int pre[MAX_V];
bool used[MAX_V];
static int V, E;
void input() {
	memset(cost, INF, sizeof(cost));
	cin >> E >> V;
	for (int i = 0; i < V; i++) {
		int a, b, w;
		cin >> a >> b >> w;
		cost[a - 1][b - 1] = w;
		cost[b - 1][a - 1] = w;
		edge[a - 1][b - 1] = 1;
		edge[b - 1][a - 1] = 1;
	}
}

void dijkstra(int s) {
	fill(d, d + V, INF);
	fill(used, used + V, false);
	fill(pre, pre + V, -1);
	d[s] = 0;

	while (true) {
		int v = -1;
		for (int u = 0; u < V; u++) {
			if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
		}
		if (v == -1) break;
		used[v] = true;

		for (int u = 0; u < V; u++) {
			if (d[u] > d[v] + cost[v][u]) {
				d[u] = d[v] + cost[v][u];
				pre[u] = v;
			}
		}
	}
}


void get_path(int t) {
	for (; t != -1; t = pre[t]) {
		edge[t][pre[t]]--;
		edge[pre[t]][t]--;
	}
}
int main()
{
	input();
	for (int i = 0; i < V; i++) {
		dijkstra(i);
		for (int j = i + 1; j < V; j++) {
			get_path(j);
		}
	}
	int ans = 0;
	for (int i = 0; i < V; i++) {
		for (int j = 0; j < V; j++) {
			if (edge[i][j] == 1) ans++;
		}
	}
	cout << ans/2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void input()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset(cost, INF, sizeof(cost));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | #include<vector>
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <limits>
#include <forward_list>

using namespace std;

struct edge {
  int to, cost, id;
};

using graph = vector<vector<edge>>;
auto dijkstra(graph const& gr, int start) {
  int const V = gr.size();
  constexpr int Inf = numeric_limits<int>::max() / 2;
  vector<pair<int, forward_list<int>>> result(V, {Inf, forward_list<int>()}); 
  using P = pair<int, int>;
  priority_queue<P, vector<P>, greater<P>> que;
  que.emplace(0, start);
  result[start].first = 0;
  while (!que.empty()) {
    int v, d;
    tie(d, v) = que.top();
    que.pop();
    if (d > result[v].first) continue;
    for (auto&& e : gr[v]) {
      if (result[e.to].first < d + e.cost) continue;
      if (result[e.to].first > d + e.cost)
        result[e.to].second.clear();
      result[e.to].first = d + e.cost;
      result[e.to].second.push_front(e.id);
      que.emplace(d + e.cost, e.to);
    }
  }
  return result;
}

int main() {
  int n, m;
  cin >> n >> m;
  graph gr(n);
  for (int i = 0; i < m; i++) {
    int a, b, cost;
    cin >> a >> b >> cost;
    a--; b--;
    gr[a].push_back({b, cost, i});
    gr[b].push_back({a, cost, i});
  }
  vector<bool> used(m, false);
  for (int i = 0; i < n; i++) {
    auto const& ds = dijkstra(gr, i);
    for (auto& v : ds)
      for (auto k : v.second)
        used[k] = true;
  }
  cout << count(begin(used), end(used), false) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:11: error: 'count' was not declared in this scope
   57 |   cout << count(begin(used), end(used), false) << endl;
      |           ^~~~~
Language: C++

def used(dp,u,v,w):
    n=len(dp)
    for i in range(n):
        for j in range(i+1,n):
            if dp[i][j]==dp[i][u]+w+dp[v][j] or dp[i][j]==dp[i][v]+w+dp[u][j]:
                return True
    return False

while 1:
    try:
        n,m=map(int,input().split())
        es=[]
        for _ in range(m):
            u,v,w=map(int,input().split())
            es.append((u-1,v-1,w))
    except: break

    dp=[[float('inf')]*n for _ in range(n)]
    for i in range(n):
        dp[i][i]=0
    for u,v,w in es:
        dp[u][v]=dp[v][u]=w
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])
    print(sum(int(not used(dp,u,v,w)) for u,v,w in es))


Compiler output:
a.cc:18:16: warning: multi-character character constant [-Wmultichar]
   18 |     dp=[[float('inf')]*n for _ in range(n)]
      |                ^~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def used(dp,u,v,w):
      | ^~~
Language: C++

#include "atcoder/all"
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using namespace atcoder;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) fixed << setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll X, Y;
  cin >> X >> Y;

  if (Y >= X)
    cout << min(Y - X, abs(X + Y) + 1) << endl;
  else
    cout << min(X - Y + 2, abs(X + Y) + 1) << endl;

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/all: No such file or directory
    1 | #include "atcoder/all"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
	ll x, y;
	cin >> x >> y;
	ll ans;
	if (x <= y) ans = y - x;
	else {
		if (x*y != 0 && x/abs(x)*y/abs(y) > 0) ans = x - y + 2;
		else ans = abs(-x-y) + 1;
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
    7 |         ll x, y;
      |         ^~
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> x >> y;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:8:16: error: 'x' was not declared in this scope
    8 |         cin >> x >> y;
      |                ^
a.cc:8:21: error: 'y' was not declared in this scope
    8 |         cin >> x >> y;
      |                     ^
a.cc:9:11: error: expected ';' before 'ans'
    9 |         ll ans;
      |           ^~~~
      |           ;
a.cc:10:21: error: 'ans' was not declared in this scope
   10 |         if (x <= y) ans = y - x;
      |                     ^~~
a.cc:12:35: error: 'abs' was not declared in this scope
   12 |                 if (x*y != 0 && x/abs(x)*y/abs(y) > 0) ans = x - y + 2;
      |                                   ^~~
a.cc:12:56: error: 'ans' was not declared in this scope
   12 |                 if (x*y != 0 && x/abs(x)*y/abs(y) > 0) ans = x - y + 2;
      |                                                        ^~~
a.cc:13:22: error: 'ans' was not declared in this scope
   13 |                 else ans = abs(-x-y) + 1;
      |                      ^~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << ans << endl;
      |         ^~~~
a.cc:15:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:17: error: 'ans' was not declared in this scope
   15 |         cout << ans << endl;
      |                 ^~~
a.cc:15:24: error: 'endl' was not declared in this scope
   15 |         cout << ans << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>
Language: C

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

int ghad(int a){
	if(a < 0)
		return a * -1;
	return a;
}

int main() {
	int a, b, f = 0;
	cin >> a >> b;
	while(a != b){
		if(ghad(a) < ghad(b)){
			a = ghad(a);
			a++;
			f++;
		}
		else if(ghad(a) > ghad(b)){
			b = ghad(b);
			b++;
			f++;	
		}
		else{
			f++;
			a *= -1;
		}
		
	}
	cout << f;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long x = sc.nextLong();
    long y = sc.nextLong();
    long count = 0;
    if(x==0){
      if(y>=0){
        System.out.println(y);
        return;
      }else{
        System.out.println(y+1);
        return;
      }
    }
    if(y==0){
      if(x<=0){
        System.out.println(Math.abs(x));
        return;
      }else{
        System.out.println(Math.abs(x)+1)
        return;
      }
    }
    if(x*y>0){
      if(y-x>0){
        System.out.println(y-x);
      }else{
        System.out.println(x-y+2);
      }
    }else{
      if(x<0){//x ga hu
        if(Math.abs(x)<=Math.abs(y)){
          System.out.println(Math.abs(y)-Math.abs(x)+1);
        }else{
          System.out.println(Math.abs(x)-Math.abs(y)+1);
        }
      }else{//y ga hu
        if (Math.abs(x)>=Math.abs(y)) {
          System.out.println(Math.abs(x)-Math.abs(y)+1);
        }else{
          System.out.println(Math.abs(y)-Math.abs(x)+1);
        }
      }
    }

  }
}


Compiler output:
Main.java:22: error: ';' expected
        System.out.println(Math.abs(x)+1)
                                         ^
1 error
Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;


template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

const ll INF=1e9+7;

int main(){
    ll x,y;
    cin >> x >> y;
    if(x<=y){
        if(x<0 && y>0 && abs(y)>=abs(x)){
            cout << 1+y+x << endl;
        }
        else{
            cout << y-x << endl;
        }
    else{
        if(x>0 && y>=0){
            cout << 1+x+y << endl;
        }
        else if(x>0 && y<0 && abs(x)>=abs(y)){
            cout << 1+x+y << endl;
        }
        else if(x>0 && y<0 && abs(x)<abs(y)){
            cout << 1-x-y << endl;
        }
        else if(x==0){
            cout << 1-y << endl;
        }
        else{
            cout << 2+x-y << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: expected '}' before 'else'
   35 |     else{
      |     ^~~~
a.cc:28:13: note: to match this '{'
   28 |     if(x<=y){
      |             ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int x, y;
  cin >> x >> y;
  if(x<y){
    if(x<0 && 0<y){
      if(-x<y){
        cout << x+y+1 << endl;
      }else if(-x>y){
        cout << y-x << endl;
      }else{
        cout << 1 << endl; 
      }
    }else{
      cout << y-x << endl;
    }
  }else{
    if(y<0 && 0<x){
      if(-y<x){
        cout << x+y+1 << endl;
      }else if(-y>x){
        cout << -y-x+1 << endl;
      }else{
        cout << 1 << endl; 
      }
    }else{
      if(x<0 && y<0){
        cout << (-y)-(-x)+2 << endl;
      }else{
        cout << x+y+1 << endl;
      }
    }
  }

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

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<utility>
#include<string>
#include<map>
#include<unordered_map>
#include<queue>

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

using namespace std;

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
ll gcd(int a, int b){return b ? gcd(b, a%b) : a;}
ll lcm(int a, int b){return a*b / gcd(a, b);}
const ll MAX = 1e9+7;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    ll x, y;
    cin >> x >> y;

    if(x <= y){
        cout << y-x << endl;
    }
    else if(y == -x){
        cout << 1 << endl;
    }
    else{
        if(y >= 0 || x <= 0){
            cout << abs(y-x) + 2 << endl;
        }
        else{
            cout << -y-x + 1 << endl;
        }
    }
        return 0;
   }
}


Compiler output:
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;

int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll a,b;
cin >> a >> b;
ll ans = 0;
if(a == 0){
    if(b > 0)
    ans += b;
    if(b < 0) {
        ans++;
        ans += b;
    }
    else{
        ans += (1 + a);
    }

}
else if(a > 0){
    if(b == 0){
        ans += b + 1;
    }
    else if(a > b && b > 0){
        ans += 2 + (a - b);
    }
    else if(abs(a) >= abs(b) && b < 0){
        ans++;
        ans += (a - abs(b));
    }
    else if(a < b && b > 0){
        ans += (b - a);
    }
    else if(abs(a) =< abs(b) && b < 0){
        ans += (abs(b) - a);
        ans++;
    }
}
else{
    if(abs(a) =< b){
        ans++;
        ans +=(b - a);
    }
    if(abs(a) >= b && b > 0){
        ans +=(b - abs(a));
        ans += 1;
    }
    if(a < b && b < 0){
        ans +=(abs(a) - abs(b));
    }
    if(a > b && b < 0){
        ans += 2;
        ans += (abs(b) - abs(a));
    }
}
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:21: error: expected primary-expression before '<' token
   42 |     else if(abs(a) =< abs(b) && b < 0){
      |                     ^
a.cc:48:16: error: expected primary-expression before '<' token
   48 |     if(abs(a) =< b){
      |                ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

using ll = long long;
using ull = unsigned long long;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

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

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

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline void print(T&& x){cout<<x<<endl;}// 改行付き出力
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int ctoi(char c){return c-'0';}


// TODO: write
int main() {
  int x,y;cin>>x>>y;
  if(x >= 0 && y >= 0){
    if(x < y)print(y-x);
    else print(x-y+2);
  }else if(x > 0){
    if(x < abs(y))print(abs(y)-x+1);
    else print(abs(y)-x+1);
  }else if(y > 0){
    if(abs(x) < y)print(y-abs(x)+1);
    else 
  }else if(x < 0 && y < 0){
    if(abs(x) < abs(y))print(abs(y-x)+2);
    else print(abs(y-x));
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:3: error: expected primary-expression before '}' token
   64 |   }else if(x < 0 && y < 0){
      |   ^
Language: C++

int main()
{
  long int x,y,z,a;
  cin>>x>>y;


  if(x>=0&&y>=0)
  {
      if(x>y)
     {
         z=x-y+2;
         if(y==0){cout<<x-y+1;}else{cout<<z;}
     }
     else{
        z=y-x;
        cout<<z;
     }

  }
  else if (x>=0&&y<=0){
        z=-x-y+1;
        a=x+y+1;


        if(x>=-y){cout<<a;}
        else{cout<<z;}

  }
  else if(x<=0&&y>=0){if (y>=-x){cout<<x+y+1;}else{cout<<y-x;}}
  else if(x<=0&&y<=0){if(x>y)
     {
         z=x-y+2;
         cout<<z;
     }
     else{
        z=y-x;
        cout<<z;
     }
     }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin>>x>>y;
      |   ^~~
a.cc:12:19: error: 'cout' was not declared in this scope
   12 |          if(y==0){cout<<x-y+1;}else{cout<<z;}
      |                   ^~~~
a.cc:12:37: error: 'cout' was not declared in this scope
   12 |          if(y==0){cout<<x-y+1;}else{cout<<z;}
      |                                     ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<z;
      |         ^~~~
a.cc:25:19: error: 'cout' was not declared in this scope
   25 |         if(x>=-y){cout<<a;}
      |                   ^~~~
a.cc:26:14: error: 'cout' was not declared in this scope
   26 |         else{cout<<z;}
      |              ^~~~
a.cc:29:34: error: 'cout' was not declared in this scope
   29 |   else if(x<=0&&y>=0){if (y>=-x){cout<<x+y+1;}else{cout<<y-x;}}
      |                                  ^~~~
a.cc:29:52: error: 'cout' was not declared in this scope
   29 |   else if(x<=0&&y>=0){if (y>=-x){cout<<x+y+1;}else{cout<<y-x;}}
      |                                                    ^~~~
a.cc:33:10: error: 'cout' was not declared in this scope
   33 |          cout<<z;
      |          ^~~~
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout<<z;
      |         ^~~~
Language: C++

include <iostream>

using namespace std;

int main()
{
  double x,y,z,a;
  cin>>x>>y;
  if(x>0&&y>0)
  {  if(x>y)
     {
         z=x+y+1;
         cout<<z;
     }
     else{
        z=y-x;
        cout<<z;
     }

  }
  else if (x>0&&y<0){
        z=-x-y+1;
        a=x+y+1;


        if(x>-y){cout<<a;}
        else{cout<<z;}

  }
  else if(x<0&&y>0){if (y>-x){cout<<x+y+1;}else{cout<<y-x;}}
  else if(x<0&&y<0){if(x>y)
     {
         z=x-y+2;
         cout<<z;
     }
     else{
        z=y-x;
        cout<<z;
     }
     }

    return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>x>>y;
      |   ^~~
a.cc:13:10: error: 'cout' was not declared in this scope
   13 |          cout<<z;
      |          ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout<<z;
      |         ^~~~
a.cc:26:18: error: 'cout' was not declared in this scope
   26 |         if(x>-y){cout<<a;}
      |                  ^~~~
a.cc:27:14: error: 'cout' was not declared in this scope
   27 |         else{cout<<z;}
      |              ^~~~
a.cc:30:31: error: 'cout' was not declared in this scope
   30 |   else if(x<0&&y>0){if (y>-x){cout<<x+y+1;}else{cout<<y-x;}}
      |                               ^~~~
a.cc:30:49: error: 'cout' was not declared in this scope
   30 |   else if(x<0&&y>0){if (y>-x){cout<<x+y+1;}else{cout<<y-x;}}
      |                                                 ^~~~
a.cc:34:10: error: 'cout' was not declared in this scope
   34 |          cout<<z;
      |          ^~~~
a.cc:38:9: error: 'cout' was not declared in this scope
   38 |         cout<<z;
      |         ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
  double x,y,z,a,b,c;
  cin>>x>>y;
  if(x>0&&y>0)
  {  if(x>y)
     {
         z=x+y+1;
         cout<<z;
     }
     else{
        z=y-x;
        cout<<z;
     }

  }
  else if (x>0&&y<0){
        z=-x-y+1;
        a=x+y+1;


        if(x>-y){cout<<a;}
        else{cout<<z;}

  }
  else if(x<0&&y>0){if (y>-x){cout<<x+y+1;}else{cout<<y-x;}}
  else if(x<0&&y<0){if(x>y)
     {
         z=x-y+2;
         cout<<z;
     }
     else{
        z=y-x;
        cout<<z;
     }
     }

    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: expected '}' at end of input
   42 |     return 0;
      |              ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^