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

#include<bits.stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
int main(){
    int h,w,mx=80*160*2,i,j,k,tmp;
    cin >> h >> w;
    vector<vector<int> > c(h,vector<int>(w));
    rep(i,h){
        rep(j,w){
            cin >> c.at(i).at(j);
        }
    }
    rep(i,h){
        rep(j,w){
            cin >> tmp;
            c.at(i).at(j)=abs(c.at(i).at(j)-tmp);
        }
    }
    bool dp[80][80][25600];
    dp[0][0][c.at(0).at(0)]=true;
    rep(i,h){
        rep(j,w){
            rep(k,mx){
                if(i){
                    if(dp[i-1][j][k]){
                        dp[i][j][k+c.at(i).at(j)]=1;
                        dp[i][j][abs(k-c.at(i).at(j))]=1;
                    }
                }
                if(j){
                    if(dp[i][j-1][k]){
                        dp[i][j][k+c.at(i).at(j)]=1;
                        dp[i][j][abs(k-c.at(i).at(j))]=1;
                    }
                }
            }
        }
    }
    rep(k,mx){
        if(dp[h-1][w-1][k]){
            cout << k << endl;
            break;
        }
    }
}

Compiler output:
a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
    1 | #include<bits.stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib> 
#include <ctime>
#include <unordered_map>
using namespace std;
typedef long long ll;
int N, A[80][80], B[80][80], R, C, dp[80][80][12804];
int f(int rr, int cc, int val) {
	if (rr == (R - 1) && cc == (C - 1)) {
		int x = abs(A[rr][cc] - B[rr][cc]);
		return abs(val - x);
	}
	int& ret = dp[rr][cc][val];
	if (ret != -1) return ret;
	ret = INT_MAX;
	if (cc != (C - 1)) {
		ret = min(ret, min(f(rr, cc + 1, val + abs(A[rr][cc] - B[rr][cc])), f(rr, cc + 1, abs(val - abs(A[rr][cc] - B[rr][cc])))));
	}
	if (rr != (R - 1)) {
		ret = min(ret, min(f(rr+1, cc, val + abs(A[rr][cc] - B[rr][cc])), f(rr+1, cc, abs(val - abs(A[rr][cc] - B[rr][cc])))));
	}
	return ret;
}
int main() {
	cin >> R >> C;
	int i, j, k;
	for (i = 0; i < R; i++) for (j = 0; j < C; j++) cin >> A[i][j];
	for (i = 0; i < R; i++) for (j = 0; j < C; j++) cin >> B[i][j];
	for (i = 0; i < R; i++) for (j = 0; j < C; j++) for (k = 0; k <= 12800; k++) dp[i][j][k] = -1;
	cout << f(0, 0, 0) << endl;
}

Compiler output:
a.cc: In function 'int f(int, int, int)':
a.cc:31:15: error: 'INT_MAX' was not declared in this scope
   31 |         ret = INT_MAX;
      |               ^~~~~~~
a.cc:20:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   19 | #include <ctime>
  +++ |+#include <climits>
   20 | #include <unordered_map>
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];
    int[][] b = new int[h][w];
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        a[i][j] = sc.nextInt();
      }
    }
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        b[i][j] = sc.nextInt();
      }
    } /**
    int[][][] dp = new int[h][w][1000000];
    dp[0][0][Math.abs(a[0][0] - b[0][0])] = 1;
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        int t = Math.abs(a[i][j] - b[i][j]);
        for(int k = 0; k < 1000000; k++) {
          if(i > 0) {
            if((((k + t) < 1000000) && (dp[i - 1][j][k + t] == 1)) || (dp[i - 1][j][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
          if(j > 0) {
            if((((k + t) < 1000000) && (dp[i][j - 1][k + t] == 1)) || (dp[i][j - 1][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
        }
      }
    } */
    int ans = 0;
    for(int i = 0; i < 10; i++) {
      if(dp[h - 1][w - 1][i] == 1) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:37: error: cannot find symbol
      if(dp[h - 1][w - 1][i] == 1) {
         ^
  symbol:   variable dp
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];
    int[][] b = new int[h][w];
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        a[i][j] = sc.nextInt();
      }
    }
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        b[i][j] = sc.nextInt();
      }
    }
/**    int[][][] dp = new int[h][w][1000000];
    dp[0][0][Math.abs(a[0][0] - b[0][0])] = 1;
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        int t = Math.abs(a[i][j] - b[i][j]);
        for(int k = 0; k < 1000000; k++) {
          if(i > 0) {
            if((((k + t) < 1000000) && (dp[i - 1][j][k + t] == 1)) || (dp[i - 1][j][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
          if(j > 0) {
            if((((k + t) < 1000000) && (dp[i][j - 1][k + t] == 1)) || (dp[i][j - 1][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
        }
      }
    }
*/
    int ans = 0;
    for(int i = 0; i < 1000000; i++) {
      if(dp[h - 1][w - 1][i] == 1) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:38: error: cannot find symbol
      if(dp[h - 1][w - 1][i] == 1) {
         ^
  symbol:   variable dp
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];
    int[][] b = new int[h][w];
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        a[i][j] = sc.nextInt();
      }
    }
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        b[i][j] = sc.nextInt();
      }
    }
/**    int[][][] dp = new int[h][w][1000000];
    dp[0][0][Math.abs(a[0][0] - b[0][0])] = 1;
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        int t = Math.abs(a[i][j] - b[i][j]);
        for(int k = 0; k < 1000000; k++) {
          if(i > 0) {
            if((((k + t) < 1000000) && (dp[i - 1][j][k + t] == 1)) || (dp[i - 1][j][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
          if(j > 0) {
            if((((k + t) < 1000000) && (dp[i][j - 1][k + t] == 1)) || (dp[i][j - 1][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
        }
      }
    }
    int ans = 0;
    for(int i = 0; i < 1000000; i++) {
      if(dp[h - 1][w - 1][i] == 1) {
        ans = i;
        break;
      }
    } */
    System.out.println(ans);
  }
}


Compiler output:
Main.java:42: error: cannot find symbol
    System.out.println(ans);
                       ^
  symbol:   variable ans
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];
    int[][] b = new int[h][w];
    /*
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        a[i][j] = sc.nextInt();
      }
    }
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        b[i][j] = sc.nextInt();
      }
    }
    int[][][] dp = new int[h][w][1000000];
    dp[0][0][Math.abs(a[0][0] - b[0][0])] = 1;
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        int t = Math.abs(a[i][j] - b[i][j]);
        for(int k = 0; k < 1000000; k++) {
          if(i > 0) {
            if((((k + t) < 1000000) && (dp[i - 1][j][k + t] == 1)) || (dp[i - 1][j][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
          if(j > 0) {
            if((((k + t) < 1000000) && (dp[i][j - 1][k + t] == 1)) || (dp[i][j - 1][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
        }
      }
    } **/
    int ans = 0;
    for(int i = 0; i < 1000000; i++) {
      if(dp[h - 1][w - 1][i] == 1) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:38: error: cannot find symbol
      if(dp[h - 1][w - 1][i] == 1) {
         ^
  symbol:   variable dp
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];
    int[][] b = new int[h][w];
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        a[i][j] = sc.nextInt();
      }
    }
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        b[i][j] = sc.nextInt();
      }
    }
    int[][][] dp = new int[h][w][1000000];
    dp[0][0][Math.abs(a[0][0] - b[0][0])] = 1;
    /*
    for(int i = 0; i < h; i++) {
      for(int j = 0; j < w; j++) {
        int t = Math.abs(a[i][j] - b[i][j]);
        for(int k = 0; k < 1000000; k++) {
          if(i > 0) {
            if((((k + t) < 1000000) && (dp[i - 1][j][k + t] == 1)) || (dp[i - 1][j][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
          if(j > 0) {
            if((((k + t) < 1000000) && (dp[i][j - 1][k + t] == 1)) || (dp[i][j - 1][Math.abs(k - t)] == 1)) dp[i][j][k] = 1;
          }
        }
      }
    } *//
    int ans = 0;
    for(int i = 0; i < 1000000; i++) {
      if(dp[h - 1][w - 1][i] == 1) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:35: error: illegal start of expression
    } *//
        ^
Main.java:36: error: '.class' expected
    int ans = 0;
        ^
2 errors
Language: C++

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

constexpr int BASE = 1500;
constexpr int INF = 1e9;

int A[100][100], B[100][100], dp[100][100][3000];

signed main() {
  int H, W;
  cin >> H >> W;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> A[i][j];
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> B[i][j];
    }
  }

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      for (int diff = 0; diff < 3000; diff++) {
        dp[i][j][diff] = false;
      }
    }
  }

  dp[0][0][BASE + A[0][0] - B[0][0]] = true;
  dp[0][0][BASE - A[0][0] + B[0][0]] = true;

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      for (int diff = 0; diff < 3000; diff++) {
        if (dp[i][j][diff]) {
          if (i + 1 < H && 0 <= diff + A[i + 1][j] - B[i + 1][j] &&
              diff + A[i + 1][j] - B[i + 1][j] < 3000) {
            dp[i + 1][j][diff + A[i + 1][j] - B[i + 1][j]] |= true;
          }
          if (j + 1 < W && 0 <= diff - A[i][j + 1] + B[i][j + 1] &&
              diff - A[i][j + 1] + B[i][j + 1] < 3s000) {
            dp[i][j + 1][diff - A[i][j + 1] + B[i][j + 1]] |= true;
          }
        }
      }
    }
  }

  int ans = INF;
  for (int diff = 0; diff < 3000; diff++) {
    if (dp[H - 1][W - 1][diff]) {
      ans = min(ans, abs(diff - BASE));
    }
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:44:50: error: unable to find numeric literal operator 'operator""s000'
   44 |               diff - A[i][j + 1] + B[i][j + 1] < 3s000) {
      |                                                  ^~~~~
Language: Java

import java.io.*;
import java.util.*;
public class Main {
	public static class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static void main(String[] args) {
		FS in = new FS();
	
		int h = in.nextInt();
		int w = in.nextInt();
		int[][] a = new int[h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				a[i][j] = in.nextInt();
		int[][] b = new int[h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				b[i][j] = in.nextInt();

		int[][][] c = new int[2][h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[0][i][j] = a[i][j] - b[i][j];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[1][i][j] = b[i][j] - a[i][j];

		int[][][] dp = new int[2][h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < 2; j++)
				Arrays.fill(dp[2][i], 160 * 160 + 1);
		
		// 0 --> a red b blue
		// 1 --> a blue b red
		dp[0][h - 1][w - 1] = c[0][h - 1][w - 1];
		dp[1][h - 1][w - 1] = c[1][h - 1][w - 1];

		for (int i = h - 1; i >= 0; i--) {
			for (int j = w - 1; j >= 0; j--) {
				if (i != 0) 
					for (int k = 0; k < 2; k++)
						for (int l = 0; l < 2; l++) {
							int put = c[k][i - 1][j] + dp[l][i][j];
							if (abs(put) < abs(dp[k][i - 1][j]))
								dp[k][i - 1][j] = put;
						}
				else if (j != 0)
					for (int k = 0; k < 2; k++)
						for (int l = 0; l < 2; l++) {
							int put = c[k][i][j - 1] + dp[l][i][j];
							if (abs(put) < abs(dp[k][i][j - 1]))
								dp[k][i][j - 1] = put;
						}
			}
		}
		
		int ans = dp[0][0][0];
		if (abs(dp[1][0][0]) < abs(ans))
			ans = dp[1][0][0];
		System.out.println(ans);
	}

	int abs(int x) { if (x < 0) return -x; return x; }
}


Compiler output:
Main.java:55: error: non-static method abs(int) cannot be referenced from a static context
							if (abs(put) < abs(dp[k][i - 1][j]))
							    ^
Main.java:55: error: non-static method abs(int) cannot be referenced from a static context
							if (abs(put) < abs(dp[k][i - 1][j]))
							               ^
Main.java:62: error: non-static method abs(int) cannot be referenced from a static context
							if (abs(put) < abs(dp[k][i][j - 1]))
							    ^
Main.java:62: error: non-static method abs(int) cannot be referenced from a static context
							if (abs(put) < abs(dp[k][i][j - 1]))
							               ^
Main.java:69: error: non-static method abs(int) cannot be referenced from a static context
		if (abs(dp[1][0][0]) < abs(ans))
		    ^
Main.java:69: error: non-static method abs(int) cannot be referenced from a static context
		if (abs(dp[1][0][0]) < abs(ans))
		                       ^
6 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main {
	public static class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static void main(String[] args) {
		FS in = new FS();
	
		int h = in.nextInt();
		int w = in.nextInt();
		int[][] a = new int[h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				a[i][j] = in.nextInt();
		int[][] b = new int[h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				b[i][j] = in.nextInt();

		int[][][] c = new int[2][h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[0][i][j] = a[i][j] - b[i][j];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[1][i][j] = b[i][j] - a[i][j];

		int[][][] dp = new int[2][h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < 2; j++)
				Arrays.fill(dp[2][i], 160 * 160 + 1);
		
		// 0 --> a red b blue
		// 1 --> a blue b red
		dp[0][h - 1][w - 1] = c[0][h - 1][w - 1];
		dp[1][h - 1][w - 1] = c[1][h - 1][w - 1];

		for (int i = h - 1; i >= 0; i--) {
			for (int j = w - 1; j >= 0; j--) {
				if (i != 0) 
					for (int k = 0; k < 2; k++)
						for (int l = 0; l < 2; l++) {
							int put = c[k][i - 1][j] + dp[l][i][j];
							if (abs(put) < abs(dp[k][i - 1][j]))
								dp[k][i - 1][j] = put;
						}
				else if (j != 0)
					for (int k = 0; k < 2; k++)
						for (int l = 0; l < 2; l++) {
							int put = c[k][i][j - 1] + dp[l][i][j];
							if (abs(put) < abs(dp[k][i][j - 1])
								dp[k][i][j - 1] = put;
						}
			}
		}
		
		int ans = dp[0][0][0];
		if (abs(dp[1][0][0]) < abs(ans))
			ans = dp[1][0][0];
		System.out.println(ans);
	}

	int abs(int x) { if (x < 0) return -x; return x; }
}


Compiler output:
Main.java:62: error: ')' expected
							if (abs(put) < abs(dp[k][i][j - 1])
							                                   ^
1 error
Language: Java

import java.io.*;
import java.util.*;
public class Main {
	public static class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static void main(String[] args) {
		FS in = new FS();
	
		int h = in.nextInt();
		int w = in.nextInt();
		int[][] c = new int[h][w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[i][j] = in.nextInt();
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				c[i][j] -= in.nextInt();

		int[][] dp = new int[h][w];
		for (int i = 0; i < h; i++)
			Arrays.fill(dp[i], 160 * 160 + 1);
		dp[h - 1][w - 1] = c[h - 1][w - 1];
		for (int i = h - 1; i >= 0; i--) {
			for (int j = w - 1; j >= 0; j--) {
				if (i != 0 && j != 0) {
					int put = c[i - 1][j - 1] + dp[i][j];
					int dist = (int) Math.abs(put);
					if (dist < (int) Math.abs(dp[i - 1][j - 1]))
						dp[i - 1][j - 1] = put;
				}
				else if (i != 0) {
					int put = c[i - 1][j] + dp[i][j];
					int dist = (int) Math.abs(put);
					if (dist < (int) Math.abs(dp[i - 1][j]))
						dp[i - 1][j] = put;
				}
				else if (j != 0) {
					int put = c[i][j - 1] + dp[i][j];
					int dist = (int) Math.abs(put);
					if (dist < (int) Math.abs(dp[i][j - 1]))
						d[i][j - 1] = put;
				}
			}
		}
		
		int ans = (int) Math.min(dp[0][0]);
		System.out.println(ans);
	}
}


Compiler output:
Main.java:52: error: cannot find symbol
						d[i][j - 1] = put;
						^
  symbol:   variable d
  location: class Main
Main.java:57: error: no suitable method found for min(int)
		int ans = (int) Math.min(dp[0][0]);
		                    ^
    method Math.min(int,int) is not applicable
      (actual and formal argument lists differ in length)
    method Math.min(long,long) is not applicable
      (actual and formal argument lists differ in length)
    method Math.min(float,float) is not applicable
      (actual and formal argument lists differ in length)
    method Math.min(double,double) is not applicable
      (actual and formal argument lists differ in length)
2 errors
Language: C++

#include <limits.h>
#include <stdio.h>
#include <string.h>

inline int diff(int a, int b){ return a<b?b-a:a-b;}

int h, w, i, j;
int l, k;
int a[81][81];
char d[81][81][12801];

int main(void) {
  	scanf("%d%d", &h, &w);
  	l = (h+w-1) * 80;
  	for(i=0;i<h;i++){
      for(j=0;j<w;j++){
        scanf("%d", &a[i][j]);
      }
    }
  	for(i=0;i<h;i++){
      for(j=0;j<w;j++){
        scanf("%d", &k);
        a[i][j] = dif(k, a[i][j]);
      }
    }
  	
  d[0][0][a[0][0]]=1;
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      for(k=0;k<=l;k++){
        if(d[i][j][k]==1){
          d[i+1][j][k+a[i+1][j]]=1;
          d[i+1][j][dif(k,a[i+1][j])]=1;
          d[i][j+1][k+a[i][j+1]]=1;
          d[i][j+1][dif(k,a[i][j+1])]=1;
        }
      }
    }
  }
  for(k=0;k<=l;k++){
    if(d[h-1][w-1][k]==1) break;
  }
  printf("%d\n", k);
  return 0;
}

      

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'dif' was not declared in this scope; did you mean 'diff'?
   23 |         a[i][j] = dif(k, a[i][j]);
      |                   ^~~
      |                   diff
a.cc:33:21: error: 'dif' was not declared in this scope; did you mean 'diff'?
   33 |           d[i+1][j][dif(k,a[i+1][j])]=1;
      |                     ^~~
      |                     diff
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool dp[85][85][166010];
int n,m,a[100][100],x;
int main(){
	cin>>n>>m;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=m;j++)
			cin>>a[i][j];
	for (int i=1;i<=n;i++)
		for (int j=1;j<=m;j++){
			cin>>x;
			a[i][j]=abs(a[i][j]-x);
		}
	for (int i=0;i<=n;i++) dp[i][0][0]=1;
	for (int i=0;i<=m;i++) dp[0][i][0]=1;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=m;j++)
			for (int k=0;k<=166000;k++)
				if (dp[i][j-1][k]==1||dp[i-1][j][k]==1){
					if (k+c[i][j]<=166000) dp[i][j][k+a[i][j]]=1;
					dp[i][j][abs(k-a[i][j])]=1;
				}
	for (int i=0;i<=166000;i++)
		if (dp[n][m][i]==1){
			cout<<i<<endl;
			break;
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:47: error: 'c' was not declared in this scope
   21 |                                         if (k+c[i][j]<=166000) dp[i][j][k+a[i][j]]=1;
      |                                               ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

int a[90][90];

const int D = 80*160+10;
const int D2 = D*2;
typedef bitset<D2> bs;

bs dp[90][90];

int main() {
    int h, w;
    cin >> h >> w;
    rep(i,h)rep(j,w) cin >> a[i][j];
    rep(i,h)rep(j,w) {
        int ai;
        cin >> ai;
        a[i][j] = abs(a[i][j]-ai);
    }
    
    dp[0][0][D-a[0][0]] = 1;
    dp[0][0][D+a[0][0]] = 1;

    rep(i,h)rep(j,w) {
        if (i) {
            dp[i][j] |= dp[i-1][j]<<a[i][j];
            dp[i][j] |= dp[i-1][j]>>a[i][j];
        }
        if (j) {
            dp[i][j] |= dp[i][j-1]<<a[i][j];
            dp[i][j] |= dp[i][j-1]>>a[i][j];
        }
    }
    int ans = D;
    rep(i,D2) {
        if (dp[h-1][w-1][i]) ans = min(ans, abs(i-D));
    }
    cout << ans << endl;
    return 0;
}














Compiler output:
a.cc:39:9: error: 'bitset' does not name a type
   39 | typedef bitset<D2> bs;
      |         ^~~~~~
a.cc:41:1: error: 'bs' does not name a type
   41 | bs dp[90][90];
      | ^~
a.cc: In function 'int main()':
a.cc:53:5: error: 'dp' was not declared in this scope
   53 |     dp[0][0][D-a[0][0]] = 1;
      |     ^~
Language: C++

H,W = map(int,input().split())
A = [list(map(int, input().split())) for _ in range(H)]
B = [list(map(int, input().split())) for _ in range(H)]


#差分だけで良い，これを*1 or -1していく
diff = [[0]*W for _ in range(H)]
for i in range(H):
    for j in range(W):
        diff[i][j] = abs(A[i][j] - B[i][j])

#i,jマスにおいて，偏りがkになれるかどうかでDP
K = 201 #適当,[-100,100]
kk = int((K-1)/2)
dp = [[[False]*K for _ in range(W)] for _ in range(H)]

dp[0][0][kk+diff[0][0]] = True
dp[0][0][kk-diff[0][0]] = True

for i in range(H):
    for j in range(W):
        for k in range(K):
            if i-1>=0:
                if k+diff[i][j]<K:
                    if dp[i-1][j][k+diff[i][j]]:
                        dp[i][j][k] =True
                if k-diff[i][j]>=0:
                    if dp[i-1][j][k-diff[i][j]]:
                        dp[i][j][k] =True
            if j-1>=0:
                if k+diff[i][j]<K:
                    if dp[i][j-1][k+diff[i][j]]:
                        dp[i][j][k] =True
                if k-diff[i][j]>=0:
                    if dp[i][j-1][k-diff[i][j]]:
                        dp[i][j][k] =True

ans = K
for k in range(K):
    if dp[H-1][W-1][k]:
        ans = min(ans,abs(k-kk))

print(ans)

Compiler output:
a.cc:6:2: error: invalid preprocessing directive #\U00005dee\U00005206\U00003060\U00003051\U00003067\U0000826f\U00003044\U0000ff0c\U00003053\U0000308c\U00003092
    6 | #差分だけで良い，これを*1 or -1していく
      |  ^~~~~~~~~~~~~~~~~~~~~~
a.cc:12:2: error: invalid preprocessing directive #i; did you mean #if?
   12 | #i,jマスにおいて，偏りがkになれるかどうかでDP
      |  ^
      |  if
a.cc:13:9: error: stray '#' in program
   13 | K = 201 #適当,[-100,100]
      |         ^
a.cc:1:1: error: 'H' does not name a type
    1 | H,W = map(int,input().split())
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
#include<map>
using namespace std;
typedef long long ll;

const int D = 80*160+10;
const int D2 = D*2;
typedef bitset<D2> bs;

int a[100][100];
bs dp[90][90];
int main(){
    int h, w; cin >> h >> w;
    rep(i, h)rep(j, w){
        int x;
        cin >> x;
        a[i][j] = x;
    }
    rep(i, h)rep(j, w) {
        int x;
        cin >> x;
        a[i][j] = abs(x-a[i][j]);
    }

    dp[0][0][D-a[0][0]] = 1;
    dp[0][0][D+a[0][0]] = 1;
    rep(i, h)rep(j, w) {
        if (i) {
            dp[i][j] |= dp[i-1][j] << a[i][j];
            dp[i][j] |= dp[i-1][j] >> a[i][j];
        }
        if (j) {
            dp[i][j] |= dp[i][j-1] << a[i][j];
            dp[i][j] |= dp[i][j-1] >> a[i][j];
        }

        int ans = D2;
        rep(i, D2) if (dp[h-1][w-1][i]) {
            ans = min(ans, abs(i-D));
        }
        cout << ans << endl;
        return 0;

    }
}

Compiler output:
a.cc:13:9: error: 'bitset' does not name a type
   13 | typedef bitset<D2> bs;
      |         ^~~~~~
a.cc:16:1: error: 'bs' does not name a type
   16 | bs dp[90][90];
      | ^~
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |     rep(i, h)rep(j, w){
      |         ^
a.cc:19:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
   19 |     rep(i, h)rep(j, w){
      |     ^~~
      |     frexp
a.cc:30:5: error: 'dp' was not declared in this scope
   30 |     dp[0][0][D-a[0][0]] = 1;
      |     ^~
Language: C++

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

#define For(i,a,b) for(int (i) = (a);(i) < (b);i++)
#define Rep(i,n) For((i),0,(n))
#define All(a) (a).begin(),(a).end()
#define sp " "
#define INF 1e18
#define INT_INF 1e9

typedef long long ll;
const ll MOD = 1000000007;
const ll MOD_9 = 998244353;


int H,W;
int Map[2][80][80];
vector<vector<vector<bool>>> dp(80,vector<vector<bool>>(80,vector<bool>(13000,0)));


int main(){
    cin >> H >> W;
    Rep(i,H){
        Rep(j,W){
            cin >> Map[0][i][j];
        }
    }
    Rep(i,H){
        Rep(j,W){
            cin >> Map[1][i][j];
        }
    }
    dp[0][0][abs(Map[0][0][0]-Map[1][0][0])] = true;
    For(i,1,H){
        int A = Map[0][i][0];
        int B = Map[1][i][0];
        int d = abs(A-B);
        Rep(x,12800){
            if(x - d >= 0) dp[i][0][x] = dp[i-1][0][x-d];
            if(x + d <= 12800 && dp[i-1][0][x+d] == true) dp[i][0][x] = true;
            if(d - x >= 0) dp[i][0][x] = (dp[i][0][x] || dp[i-1][0][d-x]));
        }        
    }
    For(i,1,W){
        int A = Map[0][0][i];
        int B = Map[1][0][i];
        int d = abs(A-B);
        Rep(x,12801){
            if(x - d >= 0) dp[0][i][x] = dp[0][i-1][x-d];
            if(x + d <= 12800 && dp[0][i-1][x+d] == true) dp[0][i][x] = true;
            if(d - x >= 0) dp[0][i][x] = (dp[0][i][x] || dp[0][i-1][d-x]));
        }        
    }
    Rep(i,H){
        Rep(j,W){
            if(i == 0 || j == 0)continue;
            int A = Map[0][i][j];
            int B = Map[1][i][j];
            int d = abs(A-B);
            Rep(x,12801){
                if(x - d >= 0) dp[i][j][x] = (dp[i][j-1][x-d] || dp[i-1][j][x-d]);
                if(x + d <= 12800) dp[i][j][x] = (dp[i][j][x] || (dp[i][j-1][x+d] || dp[i-1][j][x+d]));
                if(d - x >= 0) dp[i][j][x] = (dp[i][j][x] || (dp[i][j-1][d-x] || dp[i-1][j][d-x]));
                //if(dp[i][j][x] == true) cout << i+1 << sp << j+1 << sp << x << endl;
            } 
        }
    }
    Rep(i,12801){
        if(dp[H-1][W-1][i] == true){
            cout << i;
            break;
        }
    }
    //cin >> H;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:74: error: expected ';' before ')' token
   41 |             if(d - x >= 0) dp[i][0][x] = (dp[i][0][x] || dp[i-1][0][d-x]));
      |                                                                          ^
      |                                                                          ;
a.cc:51:74: error: expected ';' before ')' token
   51 |             if(d - x >= 0) dp[0][i][x] = (dp[0][i][x] || dp[0][i-1][d-x]));
      |                                                                          ^
      |                                                                          ;
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,m;
pair<int,int> mat[80][80];
int mi = INT_MAX;
cal(vector<pair<int,int> >v)
{
	vector<pair<int,int> >vec;
	for(int i=0;i<v.size();i++)
	{
		vec.push_back(make_pair(v[i].first,i));
		vec.push_back(make_pair(v[i].second,i));
	}
	sort(vec.begin(),vec.end());
//		for(int i=0;i<vec.size();i++)
//		{
//			cout<<vec[i].first<<" "<<vec[i].second<<" ";
//		}
//		cout<<endl;
	map<int,int>a1;
	map<int,int>b1;
	int a=0;
	int b =0;
	for(int i=0;i<vec.size();i++)
	{
		int c = vec[i].first;
		int d = vec[i].second;
		if(a == b)
		{
			if(a1[d] == 0)
			{
					a += c;
					a1[d] = 1;
			}
			else
			{
				b += c;
				b1[d] = 1;
			}
		}
		else if(a > b)
		{
			if(b1[d] == 0)
			{
				b += c;
				b1[d] = 1;
			}
			else
			{
					a += c;
					a1[d] = 1;
			}
		}
		else
		{
			if(a1[d] == 0)
			{
				a += c;
				a1[d] = 1;
			}
			else
			{
					b += c;
					b1[d] = 1;
			}
		}
	}
	mi = min(abs(a-b),mi);
}
void fun(int i,int j,vector<pair<int,int> > v)
{
	v.push_back(make_pair(mat[i][j].first,mat[i][j].second));
	//cout<<i<<" "<<j<<endl;
	if(i>=n || j>=m)
	{
		return;
	}
	if(i==n-1 && j ==m-1)
	{
		cal(v);
//		for(int i=0;i<v.size();i++)
//		{
//			cout<<v[i].first<<" "<<v[i].second<<" ";
//		}
//		cout<<endl;
		return;
	}
	fun(i+1,j,v);
	fun(i,j+1,v);
}
main()
{
	//freopen("input.txt","rt",stdin);
	cin>>n>>m;
	int A[n][m];
	int B[n][m];
	for(int i=0;i<n;i++)
	{
	 for(int j=0;j<m;j++)
	 {
	 	cin>>A[i][j];
	 }
	}
	for(int i=0;i<n;i++)
	{
	 for(int j=0;j<m;j++)
	 {
	 	cin>>B[i][j];
	 }
	}
	for(int i=0;i<n;i++)
	{
	 for(int j=0;j<m;j++)
	 {
	 	mat[i][j] = make_pair(A[i][j],B[i][j]);
	 }
	}
	vector<pair<int,int> >v;
	fun(0,0,v);
	cout<<mi<<endl;
}

Compiler output:
a.cc:7:1: error: ISO C++ forbids declaration of 'cal' with no type [-fpermissive]
    7 | cal(vector<pair<int,int> >v)
      | ^~~
a.cc: In function 'int cal(std::vector<std::pair<long long int, long long int> >)':
a.cc:70:1: warning: no return statement in function returning non-void [-Wreturn-type]
   70 | }
      | ^
a.cc: At global scope:
a.cc:92:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   92 | main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> Pii;
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1000000000
#define rep(i,a,b) for(int i =(a);i<(b);i++)
#define fs first
#define ss second
inline int Scan() {
    int x=0;int f=1; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

template<typename T, typename U>
static inline void amin(T &x, U y)
{
    if (y < x)
        x = y;
}

// call by reference is used in x
template<typename T, typename U>
static inline void amax(T &x, U y)
{
    if (x < y)
        x = y;
}
//////////////////////////////////////end of template//////////////////////////////////////

bool dp[81][81][25600];
int a[81][81];

int main(){

   int h,w;
   cin >> h >> w;
   
   int x;
   for(int i =1;i<=h;i++) for(int j =1;j<=w;j++) cin >> a[i][j]; 
   for(int i =1;i<=h;i++) for(int j =1;j<=w;j++) { cin >> x; a[i][j] = abs(a[i][j] -x)};
  
   
   for(int i=0;i<=80;i++) for(int j =0;j<=80;j++) for(int k=0;k<=12800;k++) dp[i][j][k] = false;
   
   
   dp[1][1][a[1][1]] = true;
   
   
   for(int i = 1;i<=h;i++){
	   for(int j =1;j<=w;j++){
         for(int k = 0;k<=12800;k++){
			  if( dp[i][j][k]){
                dp[i][j+1][ k + a[i][j+1]] = true;
	            dp[i][j+1][abs(k - a[i][j+1])] = true;
	            
	            dp[i+1][j][k + a[i+1][j]] = true;
	            dp[i+1][j][abs(k - a[i+1][j])] = true;
	         }   
	      }
       } 
   }
   
   for(int i = 0;i<=12800;i++){
	   if( dp[h][w][i]) {
		   cout << i << endl;
	       break;
	   }
   }
   
  return 0;
  
}




Compiler output:
a.cc: In function 'int main()':
a.cc:46:87: error: expected ';' before '}' token
   46 |    for(int i =1;i<=h;i++) for(int j =1;j<=w;j++) { cin >> x; a[i][j] = abs(a[i][j] -x)};
      |                                                                                       ^
      |                                                                                       ;
Language: C++

/**
 * Created by hiramekun at 20:44 on 2019-12-08.
 */
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {
    ll h, w;
    cin >> h >> w;
    int a[h][w], b[h][w];
    rep(i, h) rep(j, w) cin >> a[i][j];
    rep(i, h) rep(j, w) cin >> b[i][j];

    ll max_diff = 2 * 80 * 160;
    bool dp[h][w][max_diff];
    rep(i, h) rep(j, w) rep(l, max_diff) dp[i][j][l] = false;

    ll mid = max_diff / 2;
    dp[0][0][b[0][0] - a[0][0] + mid] = true;
    dp[0][0][-b[0][0] + a[0][0] + mid] = true;

    rep(i, h) {
        rep(j, w) {
            rep(l, max_diff) {
                assert(l - b[i + 1][j] + a[i + 1][j] >= 0);
                assert(l + b[i + 1][j] - a[i + 1][j] >= 0);
                if (i + 1 <= h - 1) {
                    dp[i + 1][j][l + b[i + 1][j] - a[i + 1][j]] |= dp[i][];
                    dp[i + 1][j][l - b[i + 1][j] + a[i + 1][j]] |= true;
                }
                if (j + 1 <= w - 1) {
                    dp[i][j + 1][l + b[i][j + 1] - a[i][j + 1]] |= true;
                    dp[i][j + 1][l - b[i][j + 1] + a[i][j + 1]] |= true;
                }
            }
        }
    }
    ll ans = 1e18;
    rep(i, max_diff) {
        if (dp[h - 1][w - 1][i]) ans = min(ans, abs(i - mid));
    }
    cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:74: error: expected primary-expression before ']' token
   31 |                     dp[i + 1][j][l + b[i + 1][j] - a[i + 1][j]] |= dp[i][];
      |                                                                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
#define N ((int)1e5 + 1)
#define forn(i,x,y) for(int i = int(x); i<int(y); i++)
#define debug(x) cerr << #x << " == " << (x) << '\n';
#define all(V) V.begin(), V.end()
 
template<typename T> ostream &operator<<(ostream &out, const pair<T, T> &P){ out << P.first << ' ' << P.second; return out; }
template<typename T> ostream &operator<<(ostream &out, const vector<T> &V){ for(int i = 0; i<V.size(); ++i) out << V[i] << ' '; return out; }
template<typename T> istream &operator>>(istream &in, vector<T> &V){ for(T &i : V) in >> i; return in; }
template<typename T> istream &operator>>(istream &in, pair<T,T> &P){ in >> P.first >> P.second; return in; }
 
int A[81][81], B[81][81];
int n, m;
 
int dp[81][81][10000];
 
const int inf = 1e8;
 
int solve(int i, int j, int dif) {
    if(i == n - 1 and j == m - 1) {
        int s1 = dif + A[i][j] - B[i][j];
        int s2 = dif + B[i][j] - A[i][j];
        return min(abs(s1), abs(s2));
    }
    if(abs(dif) > 5000) return inf;
 
    int &ans = dp[i][j][dif + 5000];
    if(~ans) return ans;
 
    int s1 = inf, s2 = inf, s3 = inf, s4 = inf;
 
    if(i < n - 1) {
        s1 = solve(i + 1, j, dif + A[i][j] - B[i][j]);
        s2 = solve(i + 1, j, dif + B[i][j] - A[i][j]);
    }
    if(j < m - 1) {
        s3 = solve(i, j + 1, dif + A[i][j] - B[i][j]);
        s4 = solve(i, j + 1, dif + B[i][j] - A[i][j]);
    }
 
    return ans = min(s1, min(s2, min(s3,s4)));
}
 
 
int main(){
    ios::sync_with_stdio(false); cin.tie(NULL);
    memset(dp, -1, sizeof dp);
    cin >> n >> m;
    forn(i,0,n) forn(j,0,m) cin >> A[i][j];
    forn(i,0,n) forn(j,0,m) cin >> B[i][j];
 
    cout << solve(0,0,0) << '\n';
 
    return 0;
}
 
/* don't forget to check:
   int overflow
   min/max cases (n = 1)
   printing index of sorted array
   limits for ans (start with inf)
 *

Compiler output:
a.cc:60:1: error: unterminated comment
   60 | /* don't forget to check:
      | ^
Language: C++

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

int main(){
  int N;
  scanf("%d",&N);
  int H,W;
  scanf("%d",&H); scanf("%d",&W);
  
  int table[H-1][W-1];
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      scanf("%d",&table[i][j]);
    }
  }
  int M = 0;
  for(int i = 0;i < H;i++){
    for(int j = 0; j < W;j++){
      int B;
      scanf("%d",&B);
      table[i][j] = abs(table[i][j] - B);
      M = max(M,table[i][j]);
    }
  }
  
  bool DP[80][80][15000] = {};
  DP[0][0][table[0][0]] = true;
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      for(int k = 0;k <= (H + W)* M;k++){
        if(DP[i][j][k]){
          if(j < W - 1){
            DP[i][j + 1][k + table[i][j + 1]] = true;
            Dp[i][j + 1][abs(k - table[i][j + 1])] = true;
          }
          if(i < H - 1){
            DP[i + 1][j][k + table[i + 1][j]] = true;
            DP[i + 1][j][abs(k - table[i + 1][j])] = true;
          }
        }
      }
    }
  }
  
  for(int k = 0; k <= (H + W)* M;k++){
    if(DP[H-1][W - 1][k]){
      cout << k << endl;
      break
    }
  }
  return 0;
}
            
  

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'Dp' was not declared in this scope; did you mean 'DP'?
   34 |             Dp[i][j + 1][abs(k - table[i][j + 1])] = true;
      |             ^~
      |             DP
a.cc:48:12: error: expected ';' before '}' token
   48 |       break
      |            ^
      |            ;
   49 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef  DEBUG
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif  // for local.
  int h, w;
  cin >> h >> w;
  
  int dif[h][w];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> dif[i][j];
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      int tmp; cin >> tmp;
      dif[i][j] = abs(dif[i][j] - tmp);
    }
  }
  bool dp[h][w][81];
  memset(dp, 0, sizeof(dp));
  dp[0][0][dif[0][0]] = true;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      for (int k = 0; k <= 80; k++) {
        if (i) {
          if (dp[i-1][j][k]) {
            dp[i][j][abs(k - dif[i][j])] = true;
            if (k + dif[i][j]) <= 80) {
              dp[i][j][k + dif[i][j]] = true;
            }
          }
        }
        if (j) {
          if (dp[i][j-1][k]) {
            dp[i][j][abs(k - dif[i][j])] = true;
            if (k + dif[i][j]) <= 80) {
              dp[i][j][k + dif[i][j]] = true;
            }
          }
        }
      }
    }
  }
  
  for (int i = 0; i <= 80; i++) {
    if (dp[h-1][w-1][i]) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:32: error: expected primary-expression before '<=' token
   34 |             if (k + dif[i][j]) <= 80) {
      |                                ^~
a.cc:42:32: error: expected primary-expression before '<=' token
   42 |             if (k + dif[i][j]) <= 80) {
      |                                ^~
Language: C++


using namespace std;

int g1[81][81];
int g2[81][81];
bool dp[81][81][6401];


int main() {
	int H, W;
	cin>>H>>W;
	for (int i = 0;i < H;++i) {
		for (int j = 0;j < W;++j) {
			cin>>g1[i][j];
		}
	}
	
	for (int i = 0;i < H;++i) {
		for (int j = 0;j < W;++j) {
			cin>>g2[i][j];
		}
	}
	
	dp[0][0][abs(g1[0][0] - g2[0][0])] = true;

	for (int i = 0;i < H;++i) {
		for (int j = 0;j < W;++j) {
			for (int k = 0;k <= 6400;++k) {
				if (dp[i][j][k]) {
					dp[i][j+1][abs(k - abs(g1[i][j+1] - g2[i][j+1]))] = true;
					dp[i][j+1][abs(k + abs(g1[i][j+1] - g2[i][j+1]))] = true;
					dp[i+1][j][abs(k - abs(g1[i+1][j] - g2[i+1][j]))] = true;
					dp[i+1][j][abs(k + abs(g1[i+1][j] - g2[i+1][j]))] = true;
				}
			}
		}
	}
	
	for (int i = 0;i <= 6400;++i) {
		if (dp[H-1][W-1][i]) {
			cout<<i<<endl;
			break;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin>>H>>W;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:24:18: error: 'abs' was not declared in this scope
   24 |         dp[0][0][abs(g1[0][0] - g2[0][0])] = true;
      |                  ^~~
a.cc:41:25: error: 'cout' was not declared in this scope
   41 |                         cout<<i<<endl;
      |                         ^~~~
a.cc:41:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:34: error: 'endl' was not declared in this scope
   41 |                         cout<<i<<endl;
      |                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int h = sc.nextInt();
		int w = sc.nextInt();
		int[][] A = new int[h][w];
		int[][] B = new int[h][w];
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				B[i][j] = sc.nextInt();
			}
		}
		boolean[][][] dp = new boolean[h+1][w+1][6400];
		dp[0][1][0] = true;
		dp[1][0][0] = true;
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				for(int k = 0; k < 6400; k++) {
					if(dp[i][j+1][k] || dp[i+1][j][k]) {
						int k1 = (int)Math.abs(k + A[i][j] - B[i][j]);
						if(k1 < 6400) {
							dp[i+1][j+1][k1] = true;
						}
						int k2 = (int)Math.abs(k + B[i][j] - A[i][j]);
						if(k2 < 6400) {
							dp[i+1][j+1][k2] = true;
						}
					}
				}
			}
		}
		int min = 6400;
		for(int k = 0; k < 6400; k++) {
			if(dp[h][w][k])
				min = Integer.min(k, min);
		}
		System.out.println(min);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch(IOException e) {
				throw new RuntimeException(e);
			}
		}
	}

}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

    import sys
    input=sys.stdin.readline
    h,w=map(int,input().split())
    a=[list(map(int,input().split()))for _ in range(h)]
    b=[list(map(int,input().split()))for _ in range(h)]
    l=80*40+1
    dp=[l*[False]for _ in range((h+1)*(w+1))]
    mid=l//2
    for i in range(h):
      for j in range(w):
        c=abs(a[i][j]-b[i][j])
        if i==j==0:dp[w+2][c]=True;continue
        else:
          for k in range(l-c):dp[(i+1)*(w+1)+j+1][k]=dp[i*(w+1)+j+1][abs(k-c)] or dp[(i+1)*(w+1)+j][abs(k-c)] or dp[i*(w+1)+j+1][abs(k+c)] or dp[(i+1)*(w+1)+j][abs(k+c)]
    for i in range(l):
      if dp[-1][i]:print(i);exit()

Compiler output:
a.cc:1:5: error: 'import' does not name a type
    1 |     import sys
      |     ^~~~~~
a.cc:1:5: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:36: error: expected unqualified-id before 'continue'
   12 |         if i==j==0:dp[w+2][c]=True;continue
      |                                    ^~~~~~~~
a.cc:16:35: error: expected constructor, destructor, or type conversion at end of input
   16 |       if dp[-1][i]:print(i);exit()
      |                                   ^
Language: C++

#include<iostream>
#include<array>
#include<cmath>
#include<algorithm>
using namespace std;

int h, w, a[85][85], b[85][85], grid[85][85][16000], ans, n, m;

void input(void) {
	cin >> h >> w;
	n = h; m = w;
	for (int i = 0; i < h; i++)for (int j = 0; j < w; j++)cin >> a[i][j];
	for (int i = 0; i < h; i++)for (int j = 0; j < w; j++)cin >> b[i][j];
	ans = 1000000000;
	memset(grid, -1, sizeof grid);
}

void solve(int x, int y, int diff) {
	if (x == h - 1 && y == w - 1) {
		ans = min(ans, abs(diff + (a[x][y] - b[x][y])));
		ans = min(ans, abs(diff - (a[x][y] - b[x][y])));
		return;
	}
	if (x > h || y > w)return;
	if (grid[x][y][diff] != -1)return;
	grid[x][y][diff] = 1;
	solve(x + 1, y, abs(diff + (a[x][y] - b[x][y])));
	solve(x + 1, y, abs(diff - (a[x][y] - b[x][y])));
	solve(x, y + 1, abs(diff + (a[x][y] - b[x][y])));
	solve(x, y + 1, abs(diff - (a[x][y] - b[x][y])));
}

int main() {
	input();
	solve(0, 0, 0);
	cout << ans << 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(grid, -1, sizeof grid);
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;