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

#include <iostream>
#include <vector>
#include <algorithm>
#define INF (1 << 30)
#define ll long long
#define MAX_N 16
using namespace std;

ll V, E;
ll G[MAX_N][MAX_N];
ll dp[1 << MAX_N][MAX_N];

ll rec(int S, int v) {
	if (dp[S][v] >= 0) {
		return dp[S][v];
	}

	if (S == (1 << V) - 1 && v == 0) {
		return dp[S][v] = 0;
	}

	ll res = INF;
	for (int u = 0; u < V; u++) {
		if (!(S >> u & 1)) {
			res = min(res, rec(S | 1 << u, u) + G[v][u]);
		}
	}
	return dp[S][v] = res;
}

int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	cin >> V >> E;
	for (int i = 0; i < MAX_N;i++) {
		for (int j = 0; j < MAX_N;j++) {
			G[i][j] = INF;
		}
	}
	for (int i = 0; i < E; i++) {
		int s, t, d; cin >> s >> t >> d;
		G[s][t] = d;
	}
	memset(dp, -1, sizeof(dp));
	cout << rec(0, 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:9: error: 'memset' was not declared in this scope
   43 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #define INF (1 << 30)
Language: C++

#include<stdio.h>
#include<algorithm>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <vector>
#include <iostream>
#include <string>
#include <time.h>
#include <random>
#include <functional>
using namespace std;

int dp[16][16];
int V, E;
int v[16][16] = { 0 };
list<int> li;
list<int>::iterator lp;
int Max = -1;

int same(int x) {
	for (auto i = li.begin(); i != li.end();) {
		if (*i == x) return 0;
		++i;
	}
	return 1;
}
void addsum(void) {
	int sum = 0;
	auto i = li.begin();
	auto j = i;
	++j;
	do {
		sum += v[*i][*j];
		++i; ++j;
	} while (j != li.end());
	sum += v[*i][0];
	if (sum > Max) {
		Max = sum;
	}
}
void tansaku(list<int>::iterator p) {
	if (li.size() < V) {
		for (int i = 1; i < V; ++i) {
			if (*p != i && v[*p][i] != -1) {
				if (same(i)) {
					li.push_back(i);
					tansaku(++p);
					--p;
					li.pop_back();
				}
			}
		}
	}
	else {
		if (v[*p][0] != -1) {
			addsum();
		}
	}
}
int main() {
	fill(v[0], v[16], -1);
	int s, t, d;
	scanf_s("%d %d", &V, &E);
	for (int i = 0; i < E; ++i) {
		scanf_s("%d %d %d", &s, &t, &d);
		v[s][t] = d;
	}
	li.push_back(0);
	tansaku(li.begin());
	printf("%d\n", Max);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   65 |         scanf_s("%d %d", &V, &E);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<stdio.h>
#include<algorithm>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <vector>
#include <iostream>
#include <string>
#include <time.h>
#include <random>
#include <functional>
using namespace std;

int dp[16][16];
int V, E;
int v[16][16] = { 0 };
list<int> li;
list<int>::iterator lp;
int Max = -1;

int same(int x) {
	for (auto i = li.begin(); i != li.end();) {
		if (*i == x) return 0;
		++i;
	}
	return 1;
}a
void addsum(void) {
	int sum = 0;
	auto i = li.begin();
	auto j = i;
	++j;
	do {
		sum += v[*i][*j];
		++i; ++j;
	} while (j != li.end());
	sum += v[*i][0];
	if (sum == -1 || sum < Max) {
		Max = sum;
	}
}
void tansaku(list<int>::iterator p) {
	if (li.size() < V) {
		for (int i = 1; i < V; ++i) {
			if (*p != i && v[*p][i] != -1) {
				if (same(i)) {
					li.push_back(i);
					tansaku(++p);
					--p;
					li.pop_back();
				}
			}
		}
	}
	else {
		if (v[*p][0] != -1) {
			addsum();
		}
	}
}
int main() {
	fill(v[0], v[16], -1);
	int s, t, d;
	scanf("%d %d", &V, &E);
	for (int i = 0; i < E; ++i) {
		scanf("%d %d %d", &s, &t, &d);
		v[s][t] = d;
	}
	li.push_back(0);
	tansaku(li.begin());
	printf("%d\n", Max);
}

Compiler output:
a.cc:28:2: error: 'a' does not name a type
   28 | }a
      |  ^
a.cc: In function 'void tansaku(std::__cxx11::list<int>::iterator)':
a.cc:58:25: error: 'addsum' was not declared in this scope
   58 |                         addsum();
      |                         ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 15;
const int MAX_M = 225

int n,m;
ll dp[1 << MAX_N][MAX_N];
ll d[MAX_N][MAX_N];
int s[MAX_M];
int t[MAX_M];
int D[MAX_M];

ll solve()
{
	rep(S,1<<n){
		fill(dp[S],dp[S]+n,INF);
	}
	dp[(1<<n)-1][0] = 0;
	for(int S=(1<<n)-2;S>=0;S--){
		rep(v,n){
			rep(u,n){
				if(!(S>>u&1)){
					dp[S][v] = min(dp[S][v],dp[S|1<<u][u] + d[v][u]);
				}
			}
		}
	}
	return dp[0][0];
}

int main()
{
	ll ans=INF-1;
	cin >> n >> m;
	rep(i,m){
		cin >> s[i] >> t[i] >> D[i];
	}
	rep(i,n){
		fill(d[0],d[n],INF);
		rep(j,m){
			d[(s[j]+n-i)%n][(t[j]+n-i)%n] = D[j];
		} 
		ans = min(ans,solve());
	}
	if(ans > 16000){
		cout << "-1\n";
	}else{
		cout << ans << "\n";
	}
}

Compiler output:
a.cc:14:1: error: expected ',' or ';' before 'int'
   14 | int n,m;
      | ^~~
a.cc: In function 'long long int solve()':
a.cc:23:18: error: 'n' was not declared in this scope
   23 |         rep(S,1<<n){
      |                  ^
a.cc:5:32: note: in definition of macro 'rep'
    5 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:26:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   26 |         dp[(1<<n)-1][0] = 0;
      |                ^
      |                yn
a.cc: In function 'int main()':
a.cc:42:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   42 |         cin >> n >> m;
      |                ^
      |                yn
a.cc:42:21: error: 'm' was not declared in this scope; did you mean 'tm'?
   42 |         cin >> n >> m;
      |                     ^
      |                     tm
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <climits>
#include <bitset>
#define MOD 1000000007
// INT_MAX
using namespace std;

// struct Node
// {
// 	bitset<16> bit;
// 	// vector<int> indeg;
// 	int cur;
// 	int path;
// };

class Solver
{
private:
	int v;
	int e;
	vector<vector<int> > adj;
public:
	Solver(){
		cin >> v >> e;
		adj.resize(v);
		for (int i = 0; i < v; ++i)
		{
			adj[i].resize(v);
			for (int j = 0; j < n; ++j)
			{
				adj[i][j] = INT_MAX;
			}
		}

		for (int i = 0; i < e; ++i)
		{
			int s, t, d;
			cin >> s >> t >> d;
			adj[s][t] = d;
		}
		dp = vector<vector<int> >(1 << v, vector<int>(v, INT_MAX) );
	}

	int recursive(int bit, int cur){
		if(dp[bit][cur] != INT_MAX){
			return dp[bit][cur];
		}

		if(bit == (1 << v) - 1 && cur = 0) return 0;
		int ans = INT_MAX;
		for (int i = 0; i < v; ++i)
		{
			if(bit >> i & 0){
				ans = min(ans, recursive(bit | 1 << i, i));
			}
		}
		return dp[bit][cur] = ans; 
	}

	void exec(){
		int ans = recursive(0, 0);
		if(ans == INT_MAX) ans = -1;
		cout << ans << endl;
	}
};


int main(){
	Solver s = Solver();
	s.exec();
}

Compiler output:
a.cc: In constructor 'Solver::Solver()':
a.cc:36:45: error: 'n' was not declared in this scope; did you mean 'yn'?
   36 |                         for (int j = 0; j < n; ++j)
      |                                             ^
      |                                             yn
a.cc:48:17: error: 'dp' was not declared in this scope
   48 |                 dp = vector<vector<int> >(1 << v, vector<int>(v, INT_MAX) );
      |                 ^~
a.cc: In member function 'int Solver::recursive(int, int)':
a.cc:52:20: error: 'dp' was not declared in this scope
   52 |                 if(dp[bit][cur] != INT_MAX){
      |                    ^~
a.cc:56:40: error: lvalue required as left operand of assignment
   56 |                 if(bit == (1 << v) - 1 && cur = 0) return 0;
      |                    ~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:64:24: error: 'dp' was not declared in this scope
   64 |                 return dp[bit][cur] = ans;
      |                        ^~
Language: C++

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

const int MAX_N = 15;
const int INF = (int)1e8;

int V;
int dp[MAX_N][1 << MAX_N];
vector<pair<int, int>> G[MAX_N];

int start;

int tsp(unsigned S, int v) {
  if(dp[v][S] != -1) return dp[v][S];
  if(S == 0 && v == start) return 0;
  int res = INF;
  for(int i = 0; i < (int)G[v].size(); i++) {
    int next = G[v][i].first;
    int d = G[v][i].second;
    if(S >> next & 1) {
      res = min(res, d + tsp(S & ~(1 << next), next));
    }
  }
  return dp[v][S] = res;
}

int main() {
  int E; cin >> V >> E;
  while(E--) {
    int s, t, d;
    cin >> s >> t >> d;
    G[s].push_back(make_pair(t, d));
  }
  int res = INF;
  for(int i = 0; i < V; i++) {
    start = i;
    memset(dp, -1, sizeof(dp));
    res = min(res, tsp((1 << V) - 1, i));
  }
  if(res == INF) cout << "-1" << endl;
  else cout << res << endl;
}

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

//============================================================================
// Name        : dpl_2a.cpp
// Author      : afterCmidday
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

int main() {
	int edge[15][15], v, e, dp[15][1 << 15];
	cin >> v >> e;
	memset(edge,-1,sizeof(edge));
	memset(dp,-1,sizeof(dp));
	for(int i = 0;i < v;i++){
		dp[i][0] = 0;
	}
	for(int i = 0;i < e;i++){
		int s, t, d;
		cin >> s >> t >> d;
		edge[s][t] = d;
	}
	for(int i = 0;i < (1 << v);i++){
		for(int j = 0;j < v;j++){ // now place
			if(dp[j][i] != -1){
				for(int k = 0;k < v;k++){ // next place
					if((i >> k & 1) == 0 && edge[j][k] != -1 && (dp[k][i | (1 << k)] == -1 || dp[k][i | (1 << k)] < dp[j][i] + edge[j][k])){
						dp[k][i | (1 << k)] = dp[j][i] + edge[j][k];
					}
				}
			}
		}
	}
	int ans = -1;
	for(int i = 0;i < v;i++){
		if(dp[i][(1 << v) - 1] != -1 && (ans == -1 || dp[i][(1 << v) - 1] < ans){
			ans = dp[i][(1 << v) - 1];
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:89: error: expected ')' before '{' token
   40 |                 if(dp[i][(1 << v) - 1] != -1 && (ans == -1 || dp[i][(1 << v) - 1] < ans){
      |                   ~                                                                     ^
      |                                                                                         )
a.cc:43:9: error: expected primary-expression before '}' token
   43 |         }
      |         ^
Language: Java

import java.io.*;
import java.util.Scanner;
 
public class Main {
    public static double btsp(int[] x, int[] y) {
        int n = x.length;

        double[][] aux = new double[n][n];
        for (int j = 1; j < n; j++) {
            aux[0][j] = aux[0][j-1] + distance(x[j-1], y[j-1], x[j], y[j]);
        }

        for (int i = 1; i < n; i++) {
            for (int j = i; j < n; j++) {
                if (i == j) {
                    aux[i][j] = aux[i-1][j] + distance(x[i-1], y[i-1], x[j], y[j]);}
                // } else if (i == j - 1) {
                //     double min = Double.POSITIVE_INFINITY;
                //     for (int k = 0; i < j; k++) {
                //         min = Math.min(min, aux[k][j-1] + distance(x[k], y[k], x[j-1], y[j-1]));
                //     }
                //     aux[i][j] = min;
                } else {
                    aux[i][j] = aux[i][j-1] +distance(x[j-1], y[j-1], x[j], y[j]);
                }
            }
        }
        return aux[n-1][n-1];
    }

    public static double distance(int x1, int y1, int x2, int y2) {
        return Math.sqrt((x1-x2)^2 + (y1-y2)^2);
    }

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x[] = new int[n];
        int y[] = new int[n];

        for(int i = 0; i < n; i++) {           
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
        }

        System.out.println(btsp(x, y));
    }
}


Compiler output:
Main.java:23: error: 'else' without 'if'
                } else {
                  ^
Main.java:28: error: illegal start of type
        return aux[n-1][n-1];
        ^
Main.java:28: error: ']' expected
        return aux[n-1][n-1];
                   ^
Main.java:28: error: ';' expected
        return aux[n-1][n-1];
                    ^
Main.java:28: error: <identifier> expected
        return aux[n-1][n-1];
                         ^
Main.java:31: error: unnamed classes are a preview feature and are disabled by default.
    public static double distance(int x1, int y1, int x2, int y2) {
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:48: error: class, interface, enum, or record expected
}
^
7 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>

using namespace std;

const double EPS = 1.0e-9;
const double INF = 1.0e20;

int dsign(double d) {
    if (fabs(d) < EPS) {
        return 0;
    } else {
        return d < 0 ? -1 : 1;
    }
}

struct Point {
    int x, y;

    Point(int x = 0, int y = 0) : x(x), y(y) {
    }

    bool operator<(const Point& other) const {
        return x < other.x || (x == other.x && y < other.y);
    }
};

double dist(const Point& a, const Point& b) {
    return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}

struct BiBST {
    int n;
    vector<vector<double>> dp;
    vector<vector<double>> d;
    
    double solve(vector<Point>& points, int n) {
        this->n = n;
        sort(points.begin(), points.end());
        
        d.assign(n, vector<double>(n, 0));
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                d[i][j] = dist(points[i], points[j]);
            }
        }
        dp.assign(n, vector<double>(n, -1));

        dp[0][0] = 0;
        dp[0][1] = dp[1][0] = d[0][1];

        return search(n - 1, n - 1);
    }

    double search(int i, int j) {
        //cout << i << " " << j << endl;
        if (dp[i][j] != -1) {
            return dp[i][j];
        }
        double result = INF;
        if (i < j) {
            result = search(j, i);
        } else if (i == j && i == n - 1) {
            for (int k = i - 2; k >= 0; k--) {
                result = min(result, search(i - 1, k) + d[k][i] + d[i - 1][i]);
            }
        } else if (i - j == 1) {
            for (int k = i - 2; k >= 0; k--) {
                result = min(result, search(k, j) + d[i - 2][i]);
            }
        } else if (i - j > 1) {
            result = search(i - 1, j) + d[i - 1][i];
        }
        dp[i][j] = result;
        return result;
    }
};

int main() {
    int n;
    cin >> n;
    vector<Point> a;

    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        a.push_back(Point(x, y));
    }
    double ans = solve(a, n);

    cout << fixed << setprecision(9) << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:92:18: error: 'solve' was not declared in this scope
   92 |     double ans = solve(a, n);
      |                  ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>

using namespace std;

const double EPS = 1.0e-9;
const double INF = 1.0e20;

int dsign(double d) {
    if (fabs(d) < EPS) {
        return 0;
    } else {
        return d < 0 ? -1 : 1;
    }
}

struct Point {
    int x, y;

    Point(int x = 0, int y = 0) : x(x), y(y) {
    }

    bool operator<(const Point& other) const {
        return x < other.x || (x == other.x && y < other.y);
    }
};

double dist(const Point& a, const Point& b) {
    return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}

struct BiTSP {
    int n;
    vector<vector<double>> memo;
    vector<vector<double>> d;
    
    double solve(vector<Point>& points, int n) {
        this->n = n;
        sort(points.begin(), points.end());
        
        d.assign(n, vector<double>(n, 0));
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                d[i][j] = dist(points[i], points[j]);
            }
        }
        memo.assign(n, vector<double>(n, -1));
        return search(0, 0);
    }

    double search(int i, int j) {
        if (i < j) {
            return search(j, i);
        }
        if (memo[i][j] != -1) {
            return memo[i][j];
        }
        double result = INF;
        if (i == n - 1) {
            result d[j][n - 1]; 
        }
        else {
            reuslt = min(search(i + 1, j) + d[i][i + 1], search(j, i + 1) + d[j][i + 1]); 
        }
        memo[i][j] = result;
        return result;
    }
};

int main() {
    int n;
    cin >> n;
    vector<Point> a;

    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        a.push_back(Point(x, y));
    }
    BiTSP tsp;
    double ans = tsp.solve(a, n);

    cout << fixed << setprecision(9) << ans << endl;

    return 0;
}

Compiler output:
a.cc: In member function 'double BiTSP::search(int, int)':
a.cc:63:20: error: expected ';' before 'd'
   63 |             result d[j][n - 1];
      |                    ^
a.cc:66:13: error: 'reuslt' was not declared in this scope; did you mean 'result'?
   66 |             reuslt = min(search(i + 1, j) + d[i][i + 1], search(j, i + 1) + d[j][i + 1]);
      |             ^~~~~~
      |             result
Language: C++

#include <iostream>
#include <vector>

using std::cin;
using std::cout;

struct point {
	double x, y;
	point() = default;
	point(double x, double y) : x(x), y(y) {}
	friend double distance(const point & p1, const point & p2) {
		return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
	}
};

int main() {
	size_t N;
	cin >> N;
	std::vector<point> points(N);
	for (size_t i = 0; i < N; ++i) {
		cin >> points[i].x >> points[i].y;
	}
	double ** b = new double *[N];
	for (size_t i = 0; i < N; ++i) {
		b[i] = new double[N];
	}
	b[0][1] = distance(points[0], points[1]);
	for (size_t j = 2; j < N; ++j)
		b[0][j] = b[0][j - 1] + distance(points[j - 1], points[j]);
	for (size_t i = 1; i < N; ++i) {
		for (size_t j = i + 1; j < N; ++j) {
			if (i < j - 1) {
				b[i][j] = b[i][j - 1] + distance(points[j - 1], points[j]);
			}
			else if (i == j - 1) {
				double min = b[0][j - 1] + distance(points[0], points[j]);
				for (size_t k = 1; k < i; ++k) {
					double temp = b[k][j - 1] + distance(points[k], points[j]);
					if (temp < min) {
						min = temp;
					}
				}
				b[i][j] = min;
			}
		}
	}
	size_t i = N - 2;
	cout.precision(10);
	cout << b[i][i + 1] + distance(points[i], points[i + 1]) << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'double distance(const point&, const point&)':
a.cc:12:29: error: 'pow' was not declared in this scope
   12 |                 return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
      |                             ^~~
a.cc:12:24: error: 'sqrt' was not declared in this scope
   12 |                 return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
      |                        ^~~~
Language: C++

#include <iostream>
#include <vector>

using std::cin;
using std::cout;

struct point {
	double x, y;
	point() = default;
	point(double x, double y) : x(x), y(y) {}
	friend double distance(const point & p1, const point & p2) {
		return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
	}
};

int main() {
	size_t N;
	cin >> N;
	std::vector<point> points(N);
	for (size_t i = 0; i < N; ++i) {
		cin >> points[i].x >> points[i].y;
	}
	double ** b = new double *[N];
	for (size_t i = 0; i < N; ++i) {
		b[i] = new double[N];
	}
	b[0][1] = distance(points[0], points[1]);
	for (size_t j = 2; j < N; ++j)
		b[0][j] = b[0][j - 1] + distance(points[j - 1], points[j]);
	for (size_t i = 1; i < N; ++i) {
		for (size_t j = i + 1; j < N; ++j) {
			if (i < j - 1) {
				b[i][j] = b[i][j - 1] + distance(points[j - 1], points[j]);
			}
			else if (i == j - 1) {
			double min = b[0][j - 1] + distance(points[0], points[j]);
			for (size_t k = 1; k < i; ++k) {
			double temp = b[k][j - 1] + distance(points[k], points[j]);
			        if (temp < min) {
					min = temp;
				}
			}
			b[i][j] = min;
			}
		}
	}
	size_t i = N - 2;
	cout.precision(10);
	cout << b[i][i + 1] + distance(points[i], points[i + 1]) << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'double distance(const point&, const point&)':
a.cc:12:29: error: 'pow' was not declared in this scope
   12 |                 return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
      |                             ^~~
a.cc:12:24: error: 'sqrt' was not declared in this scope
   12 |                 return sqrt(pow((p1.x - p2.x), 2) + pow((p1.y - p2.y), 2));
      |                        ^~~~
Language: Java

mport java.util.*;

class Main {
        public static void main(String args[]) {
                int H,W;
                int[][] map;
                try (Scanner sc = new Scanner(System.in)) {
                        H = sc.nextInt(), W = sc.nextInt();
                        map = new int[H][W];
                        for (int i = 0; i < H; i++) {
                                for (int j = 0; j < W; j++) {
                                        map[i][j] = sc.nextInt();
                                }
                        }
                }
                System.gc();

                int i,j,k,x;
                for (i = 0; i < H; i++) {
                        j = 0;
                        while (j < W) {
                                k = j;
                                while (k < W && map[i][k] == 0) {
                                        k++;
                                }
                                for (x = (k==W?1:0); x <= k - j; x++) {
                                        map[i][k-x] = x;
                                }
                                j = k;
                                j++;
                        }
                }
                int ans = 0;
                for (i = 0; i < H; i++) {
                        for (j = 0; j < W; j++) {
                                if (map[i][j] > ans) {
                                        boolean f = true;
                                        for (k = i; k < i+ans+1 && k < H; k++) {
                                                if(map[k][j] <= ans) {
                                                        f = false;
                                                        break;
                                                }
                                        }
                                        if (f&&k==i+ans+1) {
                                                ans++;
                                                j--;
                                        }
                                }
                        }
                }
                ans = Math.max(ans * ans, 0);
                System.out.println(ans);
        }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
Main.java:8: error: ';' expected
                        H = sc.nextInt(), W = sc.nextInt();
                                        ^
2 errors
Language: Java

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h, w;
		
		h = sc.nextInt();
		w = sc.nextInt();
		int[][] tiles = new int[h][w], map = new int[h][w];
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				tiles[i][j] = sc.nextInt();/* ???????????? */
				map[i][j] = -1;/* ?????£????????\??????????????? */
			}
		}
		sc.nextLine();

		int maxS = 0;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w;  j++){
				int ret = search(tiles, i, j, map);
				ret *= ret;
				if(ret > maxS){
					maxS = ret;
				}
			}
		}
		System.out.println(maxS);		
	}
	
	public static int search(int[][] tiles, int i, int j, int[][] map){
		if(tiles[i][j] == 1){
			return 0;
		}else if(map[i][j] != -1){
			return map[i][j];
		}else{
			int ret1, ret2, ret3;
			if(i + 1 < tiles.length && j + 1 < tiles[0].length){
				ret1 = search(tiles, i+1, j, map);
				ret2 = search(tiles, i, j+1, map);
				ret3 = search(tiles, i+1, j+1, map);
			}else{
				return 0;
			}
			if(ret1 != 0 && ret2 != 0 && ret3 != 0){
				map[i][j] = ret1 + 1;
				return map[i][j];
			}else{
				if(ret1 == 0 && ret2 == 0 && ret3 == 0){
					map[i][j] = 1;
					return map[i][j];
				}else{
					map[i][j] = 2;
					return map[i][j];
				}
			}
		}
	}

Compiler output:
Main.java:60: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.*;

public class LargestSquare {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h, w;
		
		h = sc.nextInt();
		w = sc.nextInt();
		int[][] tiles = new int[h][w], map = new int[h][w];
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				tiles[i][j] = sc.nextInt();/* ???????????? */
				map[i][j] = -1;/* ?????£????????\??????????????? */
			}
		}
		sc.nextLine();

		int maxS = 0;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w;  j++){
				int ret = search(tiles, i, j, map);
				ret *= ret;
				if(ret > maxS){
					maxS = ret;
				}
			}
		}
		System.out.println(maxS);		
	}
	
	public static int search(int[][] tiles, int i, int j, int[][] map){
		if(tiles[i][j] == 1){
			return 0;
		}else if(map[i][j] != -1){
			return map[i][j];
		}else{
			int ret1, ret2, ret3;
			if(i + 1 < tiles.length && j + 1 < tiles[0].length){
				ret1 = search(tiles, i+1, j, map);
				ret2 = search(tiles, i, j+1, map);
				ret3 = search(tiles, i+1, j+1, map);
			}else{
				return 0;
			}
			if(ret1 != 0 && ret2 != 0 && ret3 != 0){
				map[i][j] = ret1 + 1;
				return map[i][j];
			}else{
				if(ret1 == 0 && ret2 == 0 && ret3 == 0){
					map[i][j] = 1;
					return map[i][j];
				}else{
					map[i][j] = 2;
					return map[i][j];
				}
			}
		}
	}
}

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

import java.util.*;

public class LargestSquare {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h, w;
		
		h = sc.nextInt();
		w = sc.nextInt();
		int[][] tiles = new int[h][w], map = new int[h][w];
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				tiles[i][j] = sc.nextInt();/* ???????????? */
				map[i][j] = -1;/* ?????£????????\??????????????? */
			}
		}
		sc.nextLine();

		int maxS = 0;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w;  j++){
				int ret = search(tiles, i, j, map);
				ret *= ret;
				if(ret > maxS){
					maxS = ret;
				}
			}
		}
		System.out.println(maxS);		
	}
	
	public static int search(int[][] tiles, int i, int j, int[][] map){
		if(tiles[i][j] == 1){
			return 0;
		}else if(map[i][j] != -1){
			return map[i][j];
		}else{
			int ret1, ret2, ret3;
			if(i + 1 < tiles.length && j + 1 < tiles[0].length){
				ret1 = search(tiles, i+1, j, map);
				ret2 = search(tiles, i, j+1, map);
				ret3 = search(tiles, i+1, j+1, map);
			}else{
				return 0;
			}
			if(ret1 != 0 && ret2 != 0 && ret3 != 0){
				map[i][j] = ret1 + 1;
				return map[i][j];
			}else{
				map[i][j] = 1;
				return map[i][j];
			}
		}
	}
}

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

import java.util.Scanner;
import java.util.Arrays;
public class DPL_3_A {
	static int h, w,hoge=0,nextX,nextY,count=1;
	static int map[][];
	static int board[][];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		h = sc.nextInt();
		w = sc.nextInt();
		board = new int[w][h];
		map = new int[w][h];
		int flag=0;
		for (int i = 0; i < h; i++) {
			for(int j=0;j<w;j++){
				board[j][i] = sc.nextInt();
				if(j==0 || i==0){
					if(board[j][i]==0){
						flag=1;
						map[j][i]=1;
					}
					else{
						map[j][i]=0;
					}
				}
			}
		}
		if(h==1 || w==1){
			System.out.println(flag);
		}
		else{
			int ans=(int)Math.pow(squ(1,1),2),temp=0;
			while(true){
				if(hoge==1){
					hoge=0;
					//System.out.println("loop");
					temp=(int)Math.pow(squ(nextX,nextY),2);
				}
				if(hoge==0){
					break;
				}
				if(ans<temp){
					ans=temp;
				}
			}
			System.out.println(ans);
		}
		//System.out.println(Arrays.toString(map));
		/*for(int i=0;i<h;i++){
		  for(int j=0;j<w;j++){
		  System.out.print(map[j][i]+" ");
		  }
		  System.out.println();
		  }*/
	}
	static int squ(int x,int y) {
		//System.out.println("x="+x);
		if(x==w){
			//System.out.print("x=="+x);
			x=1;
			y++;
			//System.out.println(",y=="+y);
		}
		if(y==h){
			return 0;
		}
		if((y+count)*(x+count)>(100*50)*count){
			count++;
			nextX=x;
			nextY=y;
			hoge=1;
			return 0;
		}
		if(board[x][y]==1){
			map[x][y]=0;
		}
		else{
			int min=map[x-1][y];
			for(int i=-1;i<1;i++){
				//System.out.println(i);
				if(min>map[x+i][y-1]){
					min=map[x+i][y-1];
				}
			}
			map[x][y]=min+1;
		}
		int max=squ(x+1,y);
		if(max<map[x][y]){
			max=map[x][y];
		}
		return max;
	}
}

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

import java.util.Random;
import java.util.Scanner;

public class DPL3_A_Main {
	static int h,w,start=0;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		Random rnd = new Random();
		h = scan.nextInt();
		w = scan.nextInt();
		int result=0,flag=0;
		int[][] d = new int[h][w];
		int[][] dp = new int[h][w];
		for(int i=0;i<h;++i){
			flag=0;
			for(int j=0;j<w;++j){
				d[i][j]=scan.nextInt();
				if(d[i][j]==0){
					flag=1;
				}
			}
			if(flag==0){
				start++;
			}
		}
		for(int i=0;i<w;++i){
			if(d[0][i]==1){
				dp[0][i]=0;
			} else {
				dp[0][i]=1;
			}
		}
		for(int i=start;i<h;++i){
			if(d[i][0]==1){
				dp[i][0]=0;
			} else {
				dp[i][0]=1;
			}
		}
		if(start==0){
			start++;
		}
		result=cheak(d,dp,0);
		System.out.println(result*result);
	}

	public static int cheak(int[][] d, int [][] dp,int result){
		int flag=0;
		if(h==1||w==1){
			if(h==1){
				for(int i=0;i<w;++i){
					if(d[0][i]==1){
						flag=0;
					} else {
						flag=1;
						break;
					}
				}
			}
			if(w==1){
				for(int i=0;i<h;++i){
					if(d[i][0]==1){
						flag=0;
					} else {
						flag=1;
						break;
					}
				}
			}
		}
		for(int i=start;i<h;++i){
			for(int j=1;j<w;++j){
				if(d[i][j]==1){
					dp[i][j]=0;
				} else {
					flag=1;
					int num=dp[i-1][j-1];
					if(num>dp[i-1][j]){
						num=dp[i-1][j];
					}
					if(num>dp[i][j-1]){
						num=dp[i][j-1];
					}
					dp[i][j]=num+1;
				}
				if(result<dp[i][j]){
					result=dp[i][j];
				}
			}
		}
		if(result==0){
			result=1;
			if(flag!=1){
				result=0;
			}
		}
		return result;
	}
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Largest_Square {
    int h, w;
    int[][] board;

    public static void main(String args[]) {
        new Largest_Square().run();
    }

    void run() {
        FastReader sc = new FastReader();
        h = sc.nextInt();
        w = sc.nextInt();
        board = new int[h][w];
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                board[i][j] = sc.nextInt();
            }
        }
        solve();
    }

    void solve() {
        int[][] dp = new int[h][w];
        if (board[0][0] == 1) {
            dp[0][0] = 0;
        } else {
            dp[0][0] = 1;
        }
        int maxWidth = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if (board[i][j] == 1) {
                    continue;
                }
                if (i == 0 && j == 0) {
                    continue;
                }
                int temp = Integer.MAX_VALUE;
                if (i > 0 && j > 0 && board[i][j] == 0) {
                    temp = Math.min(temp, dp[i - 1][j - 1] + 1);
                }
                if (i > 0 && board[i][j] == 0) {
                    temp = Math.min(temp, dp[i - 1][j] + 1);
                }
                if (j > 0 && board[i][j] == 0) {
                    temp = Math.min(temp, dp[i][j - 1] + 1);
                }
                dp[i][j] = temp == Integer.MAX_VALUE ? 1 : temp;
                maxWidth = Math.max(maxWidth, dp[i][j]);
            }
        }
        System.out.println(maxWidth * maxWidth);
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}



Compiler output:
Main.java:6: error: class Largest_Square is public, should be declared in a file named Largest_Square.java
public class Largest_Square {
       ^
1 error
Language: C

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

main()
{
  int **d, t;
  int w, h;
  int i, j, min, ans=0;
  scanf("%d%d", &h, &w);
  d = (int **)malloc(sizeof(int *) * h);
  for(i=0; i<h; i++)
    d[i] = (int *)malloc(sizeof(int) * w);
  for(i=0; i<h; i++){
    for(j=0; j<w; j++){
      scanf("%d", &t);
      if(t==0){
        min=w+h;
        if(i>0){
          if(min>d[i-1][j]) min=d[i-1][j];
          if(j>0){
            if(min>d[i-1][j-1]) min=d[i-1][j-1];
          }
          if(min>d[i][j-1]) min=d[i][j-1];
        }
       if((d[i][j] = min) < ans) ans=min;
      }else{
        d[i][j] = 0;
      }
    }
  }
  printf("%d\n", ans*ans);
  for(i=0; i<n; i++) free(d[i]);
  free(d);
  return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:32:14: error: 'n' undeclared (first use in this function)
   32 |   for(i=0; i<n; i++) free(d[i]);
      |              ^
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

main()
{
  int **d, t;
  int w, h;
  int i, j, min, ans=0;
  scanf("%d%d", &h, &w);
  d = (int **)malloc(sizeof(int *) * h);
  for(i=0; i<h; i++)
    d[i] = (int *)malloc(sizeof(int) * w);
  for(i=0; i<h; i++){
    for(j=0; j<w; j++){
      scanf("%d", &t);
      if(t==0){
        min=w+h;
        if(i>0){
          if(min>d[i-1][j]) min=d[i-1][j];
          if(j>0 && min>d[i-1][j-1]) min=d[i-1][j-1];
        }
        if(j>0 && min>d[i][j-1]) min=d[i][j-1];
        if(min==w+h) min=1;
        if((d[i][j] = min) > ans) ans=min;
      }else{
        d[i][j] = 0;
      }
    }
  }
  printf("%d\n", ans*ans);
  for(i=0; i<n; i++) free(d[i]);
  free(d);
  return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:31:14: error: 'n' undeclared (first use in this function)
   31 |   for(i=0; i<n; i++) free(d[i]);
      |              ^
main.c:31:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include "bits/stdc++.h"

#define int long long
using namespace std;
#define rep(i, n) REP(i, 0, n)
template<typename T = int>
vector<vector<T>> vvector(int h, int w, T def = T()){ return move(vector<vector<T>>(h, vector<T>(w, def))); }

signed main()
{
	int h, w;
	while (cin >> h >> w && h)
	{
		auto dp = vvector(h, w);
		int ans = 1;
		rep(i, h) rep(j, w)
		{
			int x; cin >> x;
			if (!x) dp[i][j] = 1;
			if (i >= 1 && j >= 1 && !x)
				ans = max(ans , dp[i][j] = min({ dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1] }) + 1);
		}
		cout << ans * ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'i' was not declared in this scope
   16 |                 rep(i, h) rep(j, w)
      |                     ^
a.cc:5:23: note: in definition of macro 'rep'
    5 | #define rep(i, n) REP(i, 0, n)
      |                       ^
a.cc:5:19: error: 'REP' was not declared in this scope
    5 | #define rep(i, n) REP(i, 0, n)
      |                   ^~~
a.cc:16:17: note: in expansion of macro 'rep'
   16 |                 rep(i, h) rep(j, w)
      |                 ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 1400

int getLargestSquare(int H, int W, int G[MAX][MAX]){
  int dp[MAX][MAX];
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      dp[i][j] = (G[i][j] + 1) % 2;
    }
  }

  int maxWidth = 0;
  for(int i = 1; i < H; i++){
    for(int j = 1; j < W; j++){
      if(G[i][j]){
        dp[i][j] = 0;
      } else {
        dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
        maxWidth = max(maxWidth, dp[i][j]);
      }
    }
  }

  return maxWidth * maxWidth;
}

int main(){
  int H, W, G[MAX][MAX];
  cin >> H >> W;

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++)
      cin >> G[i][j];
  }

  cout << getLargestSquare(H, W, G)) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:36: error: expected ';' before ')' token
   39 |   cout << getLargestSquare(H, W, G)) << endl;
      |                                    ^
      |                                    ;
Language: C++

#include <cstdio>
#include <vector>

class Line_container {
public:
	Line_container(const int &w = 0) :line{new std::vector<int>(w + 1, 0) } {};
	~Line_container() { delete line; };
	int &at(const int &i) const {
		return line->at(i + 1);
	}
	int &at(const int &i) {
		return line->at(i + 1);
	}
	void swap(Line_container &other) {
		auto temp = line;
		line = other.line; other.line = temp;
	}
private:
	std::vector<int> *line;
};
template <class F, class... Args>
F min(const F &num, const Args&... args) {
	return (num < min(args...) ? num : min(args...));
}
template <class F>
F min(const F &num) {
	return num;
}
int main() {
	int h, w;
	std::scanf("%d %d", &h, &w);
	Line_container prev_line(w);
	Line_container line(w);
	int max = 0;
	for (auto i = 0; i < h; ++i) {
		for (auto j = 0; j < w; ++j) {
			int cell;
			std::scanf("%d", &cell);
			if (cell == 1) {
				line.at(j) = 0;
			}
			else {
				line.at(j) = min(prev_line.at(j - 1), prev_line.at(j), line.at(j - 1)) + 1;
				if (max < line.at(j)) {
					max = line.at(j);
				}
			}
		}
		line.swap(prev_line);
	}
	std::printf("%d", max * max);
	return 0;

}

Compiler output:
a.cc: In instantiation of 'F min(const F&, const Args& ...) [with F = int; Args = {}]':
a.cc:23:19:   recursively required from 'F min(const F&, const Args& ...) [with F = int; Args = {int}]'
   23 |         return (num < min(args...) ? num : min(args...));
      |                       ~~~^~~~~~~~~
a.cc:23:19:   required from 'F min(const F&, const Args& ...) [with F = int; Args = {int, int}]'
a.cc:43:21:   required from here
   43 |                                 line.at(j) = min(prev_line.at(j - 1), prev_line.at(j), line.at(j - 1)) + 1;
      |                                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:23:26: error: no matching function for call to 'min()'
   23 |         return (num < min(args...) ? num : min(args...));
      |                       ~~~^~~~~~~~~
a.cc:22:3: note: candidate: 'template<class F, class ... Args> F min(const F&, const Args& ...)'
   22 | F min(const F &num, const Args&... args) {
      |   ^~~
a.cc:22:3: note:   candidate expects at least 1 argument, 0 provided
a.cc:23:47: error: no matching function for call to 'min()'
   23 |         return (num < min(args...) ? num : min(args...));
      |                                            ~~~^~~~~~~~~
a.cc:22:3: note: candidate: 'template<class F, class ... Args> F min(const F&, const Args& ...)'
   22 | F min(const F &num, const Args&... args) {
      |   ^~~
a.cc:22:3: note:   candidate expects at least 1 argument, 0 provided
Language: C++

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

void solve(){
    int h,w;
    static int c[1400][1400];
    cin >> h >> w;
    rep(i,0,h) rep(j,0,w) cin >> c[i][j];
    
    static int dp[1400][1400];
    int ans;
    rep(i,0,h) rep(j,0,w){
        if(!c[i][j]) dp[i][j]=1;
        ans|=dp[i][j];
    }
    
    rep(i,1,h) rep(j,1,w){
            if(c[i][j]) continue; 
            dp[i][j]=min({dp[i-1][j],dp[i][j-1],dp[i-1][j-1]})+1;
            ans=max(ans,dp[i][j]);
        }
    }
    
    cout << ans*ans << endl;
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	solve();
	return 0;
}

Compiler output:
a.cc:52:5: error: 'cout' does not name a type
   52 |     cout << ans*ans << endl;
      |     ^~~~
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define Array 1400;
int dp[Array][Array];
int main(){
	int h, w, maxedge = 0;
	bool tail[Array][Array];
	scanf("%d%d", &h, &w);
	for (int i = 0; i < h; i++){
		for (int j = 0; j <w; j++){
			scanf("%d", &tail[i][j]);
			if (!tail[i][j]){
				dp[i][j] = 1;
				maxedge = 1;
			}
		}
	}
	for (int i = 1; i < h; i++){
		for (int j = 1; j < w; j++){
			if (!tail[i][j])
				dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
			maxedge = max(maxedge, dp[i][j]);
		}
	}
	printf("%d\n", maxedge * maxedge);
	return 0;
}

Compiler output:
a.cc:6:19: error: expected ']' before ';' token
    6 | #define Array 1400;
      |                   ^
a.cc:7:8: note: in expansion of macro 'Array'
    7 | int dp[Array][Array];
      |        ^~~~~
a.cc:7:13: error: expected unqualified-id before ']' token
    7 | int dp[Array][Array];
      |             ^
a.cc:7:20: error: expected unqualified-id before ']' token
    7 | int dp[Array][Array];
      |                    ^
a.cc: In function 'int main()':
a.cc:6:19: error: expected ']' before ';' token
    6 | #define Array 1400;
      |                   ^
a.cc:10:19: note: in expansion of macro 'Array'
   10 |         bool tail[Array][Array];
      |                   ^~~~~
a.cc:10:24: error: expected primary-expression before ']' token
   10 |         bool tail[Array][Array];
      |                        ^
a.cc:10:31: error: expected primary-expression before ']' token
   10 |         bool tail[Array][Array];
      |                               ^
a.cc:14:38: error: 'tail' was not declared in this scope
   14 |                         scanf("%d", &tail[i][j]);
      |                                      ^~~~
a.cc:16:33: error: 'dp' was not declared in this scope
   16 |                                 dp[i][j] = 1;
      |                                 ^~
a.cc:23:30: error: 'tail' was not declared in this scope
   23 |                         if (!tail[i][j])
      |                              ^~~~
a.cc:24:33: error: 'dp' was not declared in this scope
   24 |                                 dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
      |                                 ^~
a.cc:25:48: error: 'dp' was not declared in this scope
   25 |                         maxedge = max(maxedge, dp[i][j]);
      |                                                ^~
Language: C++

int height,width,tmp;
	scanf("%d %d",&height,&width);

	int** table = new int*[height+1];
	table[0] = new int[width+1];
	for(int i=0; i < width+1; i++)table[0][i] = 0;

	int max_r = 0;

	for(int i=1; i <= height; i++){
		table[i] = new int[width+1];
		table[i][0] = 0;
		for(int k=1; k <= width; k++){
			scanf("%d",&tmp);
			//table[i][k] = 1-tmp;
			if(tmp != 1){
				table[i][k] = min(table[i-1][k-1],min(table[i][k-1],table[i-1][k]))+1;
				max_r = max(max_r,table[i][k]);
			}else{
				table[i][k] = 0;
			}

		}
	}

	printf("%d\n",max_r*max_r);

Compiler output:
a.cc:2:14: error: expected constructor, destructor, or type conversion before '(' token
    2 |         scanf("%d %d",&height,&width);
      |              ^
a.cc:5:9: error: 'table' does not name a type; did you mean 'mutable'?
    5 |         table[0] = new int[width+1];
      |         ^~~~~
      |         mutable
a.cc:6:9: error: expected unqualified-id before 'for'
    6 |         for(int i=0; i < width+1; i++)table[0][i] = 0;
      |         ^~~
a.cc:6:22: error: 'i' does not name a type
    6 |         for(int i=0; i < width+1; i++)table[0][i] = 0;
      |                      ^
a.cc:6:35: error: 'i' does not name a type
    6 |         for(int i=0; i < width+1; i++)table[0][i] = 0;
      |                                   ^
a.cc:10:9: error: expected unqualified-id before 'for'
   10 |         for(int i=1; i <= height; i++){
      |         ^~~
a.cc:10:22: error: 'i' does not name a type
   10 |         for(int i=1; i <= height; i++){
      |                      ^
a.cc:10:35: error: 'i' does not name a type
   10 |         for(int i=1; i <= height; i++){
      |                                   ^
a.cc:26:15: error: expected constructor, destructor, or type conversion before '(' token
   26 |         printf("%d\n",max_r*max_r);
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int mas[1401][1401] = {0};
  int H,W;
  int minv = 1 << 30;
  cin >> H >> W;
  for(int i = 1;i <= H;i++){
    for(int j = 2;j <= W;j++){
      cin >> mas[i][j];
      if(mas[i][j])mas[i][j] = min(mas[i - 1][j - 1],min(mas[i - 1][j],mas[i][j - 1])) + 1;
      minv = min(mas[i][j]l,minv);
    }
  }
  cout << minv << endl;
  return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected ')' before 'l'
   12 |       minv = min(mas[i][j]l,minv);
      |                 ~         ^
      |                           )