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

#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

#define PROD

int main()
{
    int N, D;

#ifdef PROD
    cin >> N >> D;

    vector<vector<int>> X(N, vector<int>(D));
    auto X = int[N][D];
    for(int ii = 0 ; ii < N ; ii++) {
        for(int ij = 0 ; ij < D ; ij++) {
            cin >> X[ii][ij];
        }
    }
#else
    N = 3;
    D = 2;

    vector<vector<int>> X(N, vector<int>(D));
    X[0][0] = 1;
    X[0][1] = 2;
    X[1][0] = 5;
    X[1][1] = 5;
    X[2][0] = -2;
    X[2][1] = 8;
#endif

    auto ans = 0;

    for(int i = 0 ; i < N - 1 ; i++) {
        for(int j = i + 1; j < N ; j++) {
            int sum = 0;
            for(int k = 0 ; k < D ; k++) {
                auto diff = abs(X[i][k] - X[j][k]);
                sum += diff * diff;
            }

            for(int k = 1 ; k < sqrt(sum) + 1 ; k++) {
                if(k * k == sum) {
                    ans += 1;
                    break;
                }
            }
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: conflicting declaration 'auto X'
   17 |     auto X = int[N][D];
      |          ^
a.cc:16:25: note: previous declaration as 'std::vector<std::vector<int> > X'
   16 |     vector<vector<int>> X(N, vector<int>(D));
      |                         ^
a.cc:17:14: error: expected primary-expression before 'int'
   17 |     auto X = int[N][D];
      |              ^~~
Language: C++

#include <stdio.h>
bool IsSq(int n)
{
  for(i = 0; i*i < n; i++)
  {
  }
  return i * i == n;
}

int main()
{
  int N;
  int D;
  int pos[20][10];
  int n, d;
  scanf("%d%d", &N, &D);
  int i, j;
  for(n = 0; n < N ; n++)
  {
    for(d = 0; d < D ; d++)
    {
      scanf("%d", pos[n]+d);
    }
  }
  int sum = 0;
  for(i = 0; i < N; i++)
  {
    for(j = i+1; j < N; j++)
    {
      int d2 = 0;
      for(d = 0; d < D; d++)
      {
        d2 += (pos[i][d] - pos[j][d]) * (pos[i][d] - pos[j][d]);
      }
      if(IsSq(d2))
      {
        sum++;
      }
    }
  }
  printf("%d\n", sum);
  return 0;
}

Compiler output:
a.cc: In function 'bool IsSq(int)':
a.cc:4:7: error: 'i' was not declared in this scope
    4 |   for(i = 0; i*i < n; i++)
      |       ^
a.cc:7:10: error: 'i' was not declared in this scope
    7 |   return i * i == n;
      |          ^
Language: C++

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

int main(){
  int N,D ;
  cin >> N >> D;
  vector<vector<int>> X (N,vector<int>D);
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> X[i][j];
    }
  }
  int ans =0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;++j){
      int norm =0;
      for(int k=0;k<N;k++){
        int diff = abs(X[i][j]-X[j][k]);
        norm += diff*diff;
      }
      
      bool flag =false;
      for(int k=0;k<=norm;k++){
        if(k*k==norm){
          flag =true;
        }
      }
      if(flag)ans++;
    }
  }
  cout << ans << endl;
}

  




Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected primary-expression before 'D'
    7 |   vector<vector<int>> X (N,vector<int>D);
      |                                       ^
Language: C++

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

int main(){
  int N,D ;
  cin >> N >> D;
  vector<vector<int>> X (N,vector<int>D);
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> X[i][j];
    }
  }
  int ans =0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;++j){
      int norm =0;
      for(int k=0;k<N;k++){
        int diff = abs(X[i][j]-X[j][k]);
        norm += diff*diff;
      }
      
      bool flog =false;
      for(int k=0;k<=norm;k++){
        if(k*k==norm){
          flag =true;
        }
      }
      if(flag)ans++;
    }
  }
  cout << ans << endl;
}

  



Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected primary-expression before 'D'
    7 |   vector<vector<int>> X (N,vector<int>D);
      |                                       ^
a.cc:25:11: error: 'flag' was not declared in this scope; did you mean 'flog'?
   25 |           flag =true;
      |           ^~~~
      |           flog
a.cc:28:10: error: 'flag' was not declared in this scope; did you mean 'flog'?
   28 |       if(flag)ans++;
      |          ^~~~
      |          flog
Language: C++

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

int main(){
  int N,D ;
  cin >> N >> D;
  vector<vector<int>> X (N,vector<int>D);
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> X[i][j];
    }
  }
  int ans =0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;++j){
      int norm =0;
      for(int k=0;k<N;k++){
        int diff = abs(X[i][j]-X[j][k]);
        norm += diff*diff;
      }
      
      bool flog =false;
      for(int k=0;k<=norm;k++){
        if(k*k==norm){
          flag =true;
        }
      }
      if(flag)ans++;
    }
  }
  cout << ans << endl;
}

  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected primary-expression before 'D'
    7 |   vector<vector<int>> X (N,vector<int>D);
      |                                       ^
a.cc:25:11: error: 'flag' was not declared in this scope; did you mean 'flog'?
   25 |           flag =true;
      |           ^~~~
      |           flog
a.cc:28:10: error: 'flag' was not declared in this scope; did you mean 'flog'?
   28 |       if(flag)ans++;
      |          ^~~~
      |          flog
a.cc: At global scope:
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  	int n,d,count=0;
  	double sum=0;
	cin>>n>>d;
  	vector<vector<int>>x(n,vector<int>(d,0));
  	for(int i=0;i<n;i++){
      for(int j=0;j<d;j++){
      cin>>x[i][j];
      }      
	}
  for(int i=0;i<n;i++){
    if(i==j)continue;
   for(int j=0;j<n;j++){
   	sum+=abs(x[i-1][j]-x[i][j]);
   }
    sqrt(sum);
    if(sum==(int)sum)count++;
  }
  cout<<count/2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'j' was not declared in this scope
   14 |     if(i==j)continue;
      |           ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string.h>
#include<queue>
#include<utility>
#include<algorithm>
#include<math.h>
using namespace std;
int N,D,x[11][11]={0};
int check(int a,int b){
	int dis=0;
	for(int i=1;i<=D;i++){
		dis=dis+(x[a][i]-x[b][i])*(x[a][i]-x[b][i]);
	}
	double x,y;
	int z;
	x=(duoble)dis;
	y=sqrt(a);
	z=(int)y;
	if(z*z==dis) return 1;
	return 0;
}
int main(){
	cin>>N>>D;
	for(int i=1;i<=N;i++){
		for(int j=1;j<=D;j++){
			scanf("%d",&x[i][j]);
		}
	}
	int ans=0;
	for(int i=1;i<=N;i++)
		for(int j=i;j<=N;j++)
			ans=ans+check(i,j);
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int check(int, int)':
a.cc:18:12: error: 'duoble' was not declared in this scope; did you mean 'double'?
   18 |         x=(duoble)dis;
      |            ^~~~~~
      |            double
Language: C++

#include <stdio.h>
#include <math.h>

int main(){
  int p[10][10];
  int N, D, i, j, k, count;
  scanf("%d%d", &N, &D);
  for(i=0, i < N; i++){
    for(j=0; j<D; j++){
      scanf("%d", &p[i][j]);
    }
  }
  for(i=0; i<N-1;i++){
    for(j=i+1; j<N;j++){
      double dist = 0;
      for(k=0; k<D; k++)
        dist += pow(p[i][k] - p[j][k], 2);
      dist = sqrt(dist);
      if(ceil(dist) == floor(dist))
        count++;
    }
  }
  printf("%d", count);
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before ')' token
    8 |   for(i=0, i < N; i++){
      |                      ^
      |                      ;
Language: C++

#ifdef OJ_MISC_OFFLINE

#include "prolog.h"

#else
#define PRINT
#define LCERR
#endif

#include <algorithm>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>

namespace {

using namespace std;

class Solution {
public:
    int good_distances(const vector<vector<int>>& points) {
        const int N = points.size();
        if (points.empty()) return 0;
        const int D = points[0].size();
        int cnt = 0;
        for (int i = 0; i < N; ++i) {
            for (int j = i + 1; j < N; ++j) {
                int dist = 0;
                for (int d = 0; d < D; ++d) {
                    dist += int(pow(points[i][d] - points[j][d], 2));
                }
                if (is_sq(dist)) {
                    cnt += 1;
                }
            }
        }
        return cnt;
    }
private:

    bool is_sq(int x) {
        return int(pow(x, 0.5) + 0.5) * int(pow(x, 0.5) + 0.5) == x;
    }
};

int solve() {
    Solution solution;
    // handle IO here
    int N, D;
    cin >> N >> D;
    vector<vector<int>> points(N, vector<int>(D, 0));
    for (int i = 0; i < N; ++i) {
        for (int d = 0; d < D; ++d) {
            cin >> points[i][d];
        }
    }
    cout << solution.good_distances(points) << endl;
    return 0;
}

} // anonymous namespace

#ifdef OJ_MISC_OFFLINE

#include "epilog.h"

#else

int main() {
    return solve();
}

#endif


Compiler output:
a.cc: In member function 'int {anonymous}::Solution::good_distances(const std::vector<std::vector<int> >&)':
a.cc:34:33: error: 'pow' was not declared in this scope
   34 |                     dist += int(pow(points[i][d] - points[j][d], 2));
      |                                 ^~~
a.cc: In member function 'bool {anonymous}::Solution::is_sq(int)':
a.cc:46:20: error: 'pow' was not declared in this scope
   46 |         return int(pow(x, 0.5) + 0.5) * int(pow(x, 0.5) + 0.5) == x;
      |                    ^~~
Language: C++

#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main() {
    // 標準入力
    int n, d;
    cin >> n >> d;
 
    int y[n][d];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < d; j++) cin >> y[i][j];
    }
 
    // 距離計算
    int dis, res = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            dis = 0;
            for (int k = 0; k < d; k++) dis += (y[i][k] - y[j][k]) * (y[i][k] - y[j][k]);
             
            // sqrt()は浮動小数なので、整数にキャストしたものとの差を取って0であれば２乗数といえる
            if (sqrt(dis) * sqrt(dis) == dis[i]) res++;
        }  
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:45: error: invalid types 'int[int]' for array subscript
   35 |             if (sqrt(dis) * sqrt(dis) == dis[i]) res++;
      |                                             ^
Language: C++

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

int main(){
    int N,D;
    cin >> N >> D;
    int A,B;
    int X[N][D]={};

    for(int i = 0;i<N;i++){
        for(int j = 0;j<D;j++){
            cin >> X[i][j];
        }
    }

    int count = 0;

    for(int i = 0;i<N;i++){
        for(int j = i+1;j<N;j++){
            int norm = 0;
            for(int k = 0;k<D;k++){
                norm += pow(abs(X[i][k]-X[j][k]),2)
            }
            bool flag = false;
            for(int k = 0;k<=norm;++k){
                if(k*k == norm){
                    flag = true;
                }
            }
            if(flag) count++;
        }
    }

cout << count << endl;






}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:52: error: expected ';' before '}' token
   22 |                 norm += pow(abs(X[i][k]-X[j][k]),2)
      |                                                    ^
      |                                                    ;
   23 |             }
      |             ~
Language: C++

#include <bits/stdc++.h>

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
 
    vi squares;
    F0R(i, 1000) {
        squares.pb(i*i);
    }
 
    int N; cin >> N; int D; cin >> D;
    int coord[N][D];
 
    F0R(i, N) {
        F0R(j, D) {
            cin >> coord[i][j];
        }
    }
 
    int ans = 0;
 
    F0R(i, N) {
        FOR(j, i+1, N) {
            int dist = 0;
            F0R(k, D) {
                dist += (coord[i][k] - coord[j][k]) * (coord[i][k] - coord[j][k]);
            }
            F0R(k, 1000) {
                if (squares[k] == dist) ans++;
            }
        }
    }
 
    cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc:20:33: error: 'tree' does not name a type
   20 | template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
      |                                 ^~~~
Language: Java

public class Main {
 	public static void main(String[] args){
    	Scanner s = new Scanner(System.in);
      	int n = s.nextInt();
      	int m = s.nextInt();
      	int[][] arr = new int[n][m];
      	for(int i = 0; i < n; i++) {
         	for(int j = 0; j < m; j++) {
             	arr[i][j] = s.nextInt();
            }
        }
      
      	int count = 0;
      	for(int i = 0; i < n; i++ ) {
         	for(int j = i + 1; j < n; j++) {
              	int sum = 0;
            	for(int k = 0; k < m; k++ ){
                 	 sum += Math.pow(arr[j][k] - arr[i][k], 2);
                }
              	int sqrt = (int)(Math.sqrt(sum));
              	if(sqrt * sqrt == sum) {
                	count++;
                }
            }
        }
      System.out.println(count);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
    	Scanner s = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    	Scanner s = new Scanner(System.in);
    	                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

using namespace std;

#define square(s) (s)*(s)
#define scast(type,e) static_cast<type>(e)
template<class T>
using vec = vector<T>;

int main() {
	int n, d;
	cin >> n >> d;
	vec<vec<int>> X(n);
	for (int i = 0; i < n; i++) {
		X[i].resize(d);
		for (int j = 0; j < d; j++) {
			cin >> X[i][j];
		}
	}
	
	auto solve = [&](int l, int r)->bool {
		int sum = 0;
		for (int i = 0; i < d; i++) {
			sum += square(X[l][i] - X[r][i]);
		}
		auto res = sqrt(sum);
		return res - scast(double, scast(int, res)) == 0;
	};

	int res = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (solve(i,j))res++;
		}
	}
	cout << res << endl;

	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:29:28: error: 'sqrt' was not declared in this scope
   29 |                 auto res = sqrt(sum);
      |                            ^~~~
Language: C++

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

using namespace std;

#define square(s) (s)*(s)
#define scast(type,e) static_cast<type>(e)
template<class T>
using vec = vector<T>;

int main() {
	int n, d;
	cin >> n >> d;
	vec<vec<int>> X(n);
	for (int i = 0; i < n; i++) {
		X[i].resize(d);
		for (int j = 0; j < d; j++) {
			cin >> X[i][j];
		}
	}
	
	auto solve = [&](int l, int r) {
		int sum = 0;
		for (int i = 0; i < d; i++) {
			sum += square(X[l][i] - X[r][i]);
		}
		auto res = sqrt(sum);
		return res - scast(double, scast(int, res)) == 0;
	};

	int res = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (solve(i,j))res++;
		}
	}
	cout << res << endl;

	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:29:28: error: 'sqrt' was not declared in this scope
   29 |                 auto res = sqrt(sum);
      |                            ^~~~
Language: C++

void solve();

int main() {
	solve();
	return 0;
}

//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <iomanip>
#include <string>

using namespace std;

long double eps = 1e-12;
vector<vector<long double>> POINTS;
int D, N;

void solve() {
	cin >> N >> D;
	POINTS.resize(N);
	for (int n = 0; n < N; n++) {
		POINTS[n].resize(D);
		for (int d = 0; d < D; d++) {
			cin >> POINTS[n][d];
		}
	}
	int counter = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			long double dist = 0;
			for (int d = 0; d < D; d++) {
				dist += (POINTS[i][d] - POINTS[j][d]) * (POINTS[i][d] - POINTS[j][d]);
			}
			dist = sqrt(dist);
			if (abs(dist - floor(dist)) < eps)counter++;
		}
	}
	cout << counter << endl;
	return;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:32: error: 'sqrt' was not declared in this scope
   39 |                         dist = sqrt(dist);
      |                                ^~~~
a.cc:40:40: error: 'floor' was not declared in this scope
   40 |                         if (abs(dist - floor(dist)) < eps)counter++;
      |                                        ^~~~~
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        int n = s.nextInt() , d = s.nextInt();
      	long[] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
          long val = 0;
        	for(int k = 0;k < d;++k){
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:7: error: incompatible types: long[][] cannot be converted to long[]
      	long[] arr = new long[n][d];
      	             ^
Main.java:11: error: array required, but long found
            	arr[i][j] = s.nextLong();
            	      ^
Main.java:24: error: array required, but long found
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                        ^
Main.java:24: error: array required, but long found
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                                    ^
4 errors
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        long n = s.nextInt() , d = s.nextInt();
      	long[][] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
          long val = 0;
        	for(int k = 0;k < d;++k){
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[][] arr = new long[n][d];
      	                        ^
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[][] arr = new long[n][d];
      	                           ^
2 errors
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        long n = s.nextInt() , d = s.nextInt();
      	long[] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
          long val = 0;
        	for(int k = 0;k < d;++k){
            	val += (long)Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[] arr = new long[n][d];
      	                      ^
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[] arr = new long[n][d];
      	                         ^
Main.java:7: error: incompatible types: long[][] cannot be converted to long[]
      	long[] arr = new long[n][d];
      	             ^
Main.java:11: error: array required, but long found
            	arr[i][j] = s.nextLong();
            	      ^
Main.java:24: error: array required, but long found
            	val += (long)Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                              ^
Main.java:24: error: array required, but long found
            	val += (long)Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                                          ^
6 errors
Language: C++

#include <stdio.h>
#define norm(X) ((X) * (X))

_Bool issq(int n);
int   dist(int i, int j);

int n, d;
int p[15][15];

int main()
{
    int ans = 0;

    scanf("%d %d", &n, &d);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < d; j++) {
            scanf("%d", &p[i][j]);
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (issq(dist(i, j))) {
                ans++;
            }
        }
    }

    printf("%d\n", ans);

    return 0;
}

_Bool issq(int n)
{
    int i = 0;
    while (i * i < n) i++;

    if (i * i == n) return 1;
    else return 0;
}

int dist(int i, int j)
{
    int dis = 0;
    
    for (int k = 0; k < d; k++) {
        dis += norm(p[i][k] - p[j][k]);
    }

    return dis;
}


Compiler output:
a.cc:4:1: error: '_Bool' does not name a type
    4 | _Bool issq(int n);
      | ^~~~~
a.cc: In function 'int main()':
a.cc:23:17: error: 'issq' was not declared in this scope
   23 |             if (issq(dist(i, j))) {
      |                 ^~~~
a.cc: At global scope:
a.cc:34:1: error: '_Bool' does not name a type
   34 | _Bool issq(int n)
      | ^~~~~
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        long n = s.nextInt() , d = s.nextInt();
      	long[] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
          long val = 0;
        	for(int k = 0;k < d;++k){
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[] arr = new long[n][d];
      	                      ^
Main.java:7: error: incompatible types: possible lossy conversion from long to int
      	long[] arr = new long[n][d];
      	                         ^
Main.java:7: error: incompatible types: long[][] cannot be converted to long[]
      	long[] arr = new long[n][d];
      	             ^
Main.java:11: error: array required, but long found
            	arr[i][j] = s.nextLong();
            	      ^
Main.java:24: error: array required, but long found
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                        ^
Main.java:24: error: array required, but long found
            	val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	                                    ^
6 errors
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        long n = s.nextInt() , d = s.nextInt();
      	long[] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
        	for(int k = 0;k < d;++k){
            	long val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:23: error: ';' expected
            	long val += Math.pow( (arr[j][k] - arr[i][k]) , 2 ); 
            	        ^
1 error
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
    
    	Scanner s = new Scanner(System.in);
        long n = s.nextInt() , d = s.nextInt();
      	long[] arr = new long[n][d];
      
      	for(int i = 0;i < n;i++){
        	for(int j = 0;j < d;++j){
            	arr[i][j] = s.nextLong();
            } 
        } 
      
      int count = 0;
      long ans = 0;
    
      for(int i = 0;i < n;i++){
      
      	for(int j = i + 1;j < n;j++){
        
        	for(int k = 0;k < d;++k){
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            }
          
          long a = (long)Math.sqrt(val);
          if(a*a == val) count++;
        
        }
      
      }
      
      System.out.println(count);
      
    }
  
}

Compiler output:
Main.java:23: error: ';' expected
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            	        ^
Main.java:23: error: not a statement
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            	                       ^
Main.java:23: error: ';' expected
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            	                                  ^
Main.java:23: error: not a statement
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            	                                               ^
Main.java:23: error: ';' expected
            	long val += (arr[j][k] - arr[i][k])*(arr[j][k] - arr[i][k]); 
            	                                                          ^
5 errors
Language: C

#include<stdio.h>
#include<math.h>

int main(){
  int N,D,i,j,,count = 0;
  double s;

  
  scanf("%d %d", &N, &D);
   int X[N][D];
  int k = (N * (N-1))/2;
  for(i = 0; i<N; i++){
    for(j = 0; j<D; j++){
      scanf("%d",&X[i][j]);
    }
  }

  for(i=0; i<N-1; i++){
    for(j=i+1; j<D; j++){
       s = 0;
       for(int a =0;a<D;a++){
        s += pow(X[i][j] - X[i+1][j],2);
       }
        double m = sqrt(s);
        if(ceil(m) == floor(m)){
          count++;
        }
    }
  }
  
  printf("%d",count);
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: expected identifier or '(' before ',' token
    5 |   int N,D,i,j,,count = 0;
      |               ^
main.c:26:11: error: 'count' undeclared (first use in this function)
   26 |           count++;
      |           ^~~~~
main.c:26:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>

int main(){
  int N,D,i,j;
  
  scanf("%d %d", &N, &D);
   int X[N][D];
  int k = (N * (N-1))/2;
  for(i = 0; i<N; i++){
    for(j = 0; j<D; j++){
      scanf("%d",&X[i][j]);
    }
  }

  for(i=0; i<n-1; i++){
    for(j=i+1; j<D; j++){
       s = 0;
       for(int a =0;a<D;a++){
        s += pow(X[i][j] - X[i+1][j],2);
       }
      int m = sqrt(s);
        if(ceil(m) == floor(m)){
          count++;
        }
    }
  }
  
  printf("%d",count);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:16:14: error: 'n' undeclared (first use in this function)
   16 |   for(i=0; i<n-1; i++){
      |              ^
main.c:16:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:8: error: 's' undeclared (first use in this function)
   18 |        s = 0;
      |        ^
main.c:24:11: error: 'count' undeclared (first use in this function)
   24 |           count++;
      |           ^~~~~
Language: C

#include<stdio.h>
#include<math.h>

#define sqr(n) ((n) * (n))
double distance(int X[10][10],int n,int D){
  int count = 0;
  int i,j,s;
  for(i=0; i<n-1; i++){
    for(j=i+1; j<D; j++){
       s = 0;
        s += sqr(X[i][j] - X[i+1][j]);
    }
  }
  int m = sqrt(s)
  if(ceil(m) == floor(m)){
    count++;
  }
  return count;
}
int main(){
  int N,D,i,j;
  int X[10][10];
  scanf("%d %d", &N, &D);
  int k = (N * (N-1))/2;
  for(i = 0; i<N; i++){
    for(j = 0; j<D; j++){
      scanf("%d",&X[i][j]);
    }
  }
  
  printf("%d", distance(X,k, D));
  return 0;

}

Compiler output:
main.c: In function 'distance':
main.c:15:3: error: expected ',' or ';' before 'if'
   15 |   if(ceil(m) == floor(m)){
      |   ^~
Language: C

#include<stdio.h>
#include<math.h>

#define sqr(n) ((n) * (n))
double distance(int X[10][10],int n,int D){
  int count = 0;
  int i,j,s;
  for(i=0; i<n-1; i++){
    for(j=i+1; j<D; j++){
       s = 0;
        s += sqr(X[i][j] - X[i+1][j]);
    }
  }
  int m = sqrt(s)
  if(ceil(m) == floor(m){
    count++;
  }
  return count;
}
int main(){
  int N,D,i,j;
  int X[10][10];
  scanf("%d %d", &N, &D);
  int k = (N * (N-1))/2;
  for(i = 0; i<N; i++){
    for(j = 0; j<D; j++){
      scanf("%d",&X[i][j]);
    }
  }
  
  printf("%d", distance(X,k, D));
  return 0;

}

Compiler output:
main.c: In function 'distance':
main.c:15:3: error: expected ',' or ';' before 'if'
   15 |   if(ceil(m) == floor(m){
      |   ^~
Language: C++

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

int main(){
	int N, D;
	cin >> N >> D;
	vector<vector<int>> X(N, vector<int>(D));
	for(int i = 0; i < N; i++){
		for(int j = 0; j < D; j++){
			cin >>X.at(i).at(j);
		}
	}
	int cnt = 0;
	
	for(int i = 0; i < N; i++){
		for(int j = i + 1; j < N; j++){
			int a = 0;
			int dis = 0;
			while(a < D){
				dis += (X.at(i).at(a) - X.at(j).at(a)) * (X.at(i).at(a) - X.at(j).at(a));
				a++;
			}
			double ans = sqrt(dis);
			double div = 1;
			if(ans % div == 0) cnt++;
		}
	}
	
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   26 |                         if(ans % div == 0) cnt++;
      |                            ~~~ ^ ~~~
      |                            |     |
      |                            |     double
      |                            double
Language: C++

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

int main(){
	int N, D;
	cin >> N >> D;
	vector<vector<int>> X(N, vector<int>(D));
	for(int i = 0; i < N; i++){
		for(int j = 0; j < D; j++){
			cin >>X.at(i).at(j);
		}
	}
	int cnt = 0;
	
	for(int i = 0; i < N; i++){
		for(int j = i + 1; j < N; j++){
			int a = 0;
			int dis = 0;
			while(a < D){
				dis += (X.at(i).at(a) - X.at(j).at(a)) * (X.at(i).at(a) - X.at(j).at(a));
				a++;
			}
			double ans = sqrt(dis);
			if(ans % 1 == 0) cnt++;
		}
	}
	
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:32: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   25 |                         if(ans % 1 == 0) cnt++;
      |                            ~~~ ^ ~
      |                            |     |
      |                            |     int
      |                            double
Language: C

#include<stdio.h>
 
int main(){
  int N, D, X[10][10];
  int i, j, k, count = 0, cal;
  
  scanf("%d %d", &N, &D);
  for(i = 0; i < N, i++){
    for(j = 0; j < D; j++){
      scanf("%d", &X[i][j]);
    }
  }
  
  for(i = 0; i < N; i++){
    for(j = i+1; j < N; j++){
      cal = 0;
      for(k = 0; k < D; k++){
        cal += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]);
      }
      for(k = 1; k*k <= cal; k++){
        if(k*k == cal){
          count++;
          break;
        }
      }
    }
  }
  
  printf("%d", count);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:24: error: expected ';' before ')' token
    8 |   for(i = 0; i < N, i++){
      |                        ^
      |                        ;
Language: C

#include<stdio.h>

int main(){
  int N, D, X[10][10];
  int i, j, k, count = 0, cal;
  
  scanf("%d %d", N, D);
  for(i = 0; i < N, i++){
    for(j = 0; j < D; j++){
      scanf("%d", &X[i][j]);
    }
  }
  
  for(i = 0; i < N; i++){
    for(j = i+1; j < N; j++){
      cal = 0;
      for(k = 0; k < D; k++){
        cal += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]);
      }
      for(k = 1; k*k <= cal; k++){
        if(k*k == cal){
          count++;
          break;
        }
      }
    }
  }
  
  printf("%d", count);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:24: error: expected ';' before ')' token
    8 |   for(i = 0; i < N, i++){
      |                        ^
      |                        ;
Language: C

#include<stdio.h>
#include<math.h>

int main(){
  int i, j, num, count = 0;
  float distance = 0;
  
  int n, d;
  scanf("%d %d", &n &d);
  
  int x[n][d];
  for(i = 0; i < n; i++){
    for(j = 0; j < d; j++){
      scanf("%d", x[i][j]);
    }
  }
  
  for(i = 0; i < n-1; i++){
    for(j = i+1; j < n; j++){
      for(num = 0; num < d; num++){
        distance += x[i][num] * x[j][num];
      }
      distance = sqrtf(distance);
      if(distance == (int)distance){
        count++;
      }
    }
  }
  
  printf("%d",count);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:21: error: invalid operands to binary & (have 'int *' and 'int')
    9 |   scanf("%d %d", &n &d);
      |                  ~~ ^
      |                  |
      |                  int *
Language: Java

import java.util.*;
public class Good_distance{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int D=sc.nextInt();
		int X[][]=new int[N][D];
		int Distsq=0;
		double Residue;
		int count=0;
		for(int i=0;i<N;i++) {
			for(int j=0;j<D;j++) {
				X[i][j]=sc.nextInt();
			}
		}
		for(int k=0;k<(N-1);k++) {
			for(int l=(k+1);l<N;l++) {
				for(int m=0;m<D;m++) {
					Distsq+=(int)Math.pow((X[k][m]-X[l][m]),2);
				}
				Residue=Math.sqrt(Distsq)-Math.round(Math.sqrt(Distsq));
				if(Residue==0) {
					count++;
				}
				Distsq=0;
			}
		}
		System.out.println(count);
	}
}

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

#include<stdio.h>
#include<math.h>
int main()
{
	int a[10][10],n,d,m=0;
	double b;
	scanf("%d%d",&n,&d);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<d;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			b=0;
			for(int k=0;k<d;k++)
			{
				b=b+(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
			}
			b=sqrt(b);
			if(b-int(b)==0)
			m++;
		}
	}
	printf("%d",m);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:30: error: expected expression before 'int'
   25 |                         if(b-int(b)==0)
      |                              ^~~
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
	int a[10][10],n,d,m=0;
	double b;
	scanf("%d%d",&n,&d);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<d;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			b=0;
			for(int k=0;k<d;k++)
			{
				b=b+pow(a[i][k]-a[j][k],2);
			}
			b=sqrt(b);
			if(b-int(b)==0)
			m++;
		}
	}
	printf("%d",m);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:30: error: expected expression before 'int'
   25 |                         if(b-int(b)==0)
      |                              ^~~
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
	int a[10][10],n,d,m=0;
	double b;
	scanf("%d%d",&n,&d);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<d;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			for(int k=0;k<d;k++)
			{
				b=pow(a[i][k]-a[j][k],2);
			}
			b=sqrt(b);
			if(b-int(b)==0)
			m++;
		}
	}
	printf("%d",m);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:30: error: expected expression before 'int'
   24 |                         if(b-int(b)==0)
      |                              ^~~
Language: C++

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

int main() {
  int n, d; cin >> n >> d;
  vector<vector<int>> x(n, vector<int>(d));
  rep(i,n) {
    rep(j,d) cin >> x[i][j];
  }
  int ans = 0;
  rep(i,n)rep(j,i) {
    int sq = 0;
    rep(k,d) {
      int s = x[i][k] - x[j][k];
      sq += s*s;
    }
    int s = sqsrt(sq)+0.5; // 1.999999...
    if (s*s == sq) ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'sqsrt' was not declared in this scope; did you mean 'sqrt'?
   18 |     int s = sqsrt(sq)+0.5; // 1.999999...
      |             ^~~~~
      |             sqrt
Language: C++

#include<iostream>
#include<map>
#include<algorithm>
#include<functional>
#include<bitset>
#include<vector>
#include<set>
using  namespace std;
#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mp make_pair
const int  MOD = 1e9 + 7, OO = 1e9;
const int  N = 2e5 + 10;
int a[30][30], calc[30];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int  n, d;
	cin >> n >> d;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= d; ++j) {
			cin >> a[i][j];
			calc[i] += a[i][j];
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = i + 1; j <= n; ++j) {
			int sum = 0;
			for (int k = 1; k <= d; ++k) {
				sum += (a[i][k] - a[j][k])*(a[i][k] - a[j][k]);
			}
			int sq = sqrt(sum);
			if (sq*sq == sum)
				++ans;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:34: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   36 |                         int sq = sqrt(sum);
      |                                  ^~~~
      |                                  sq
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,d;
     cin>>n>>d;
     vector<int>vect[n];
  
       for(int i=0;i<n;i++)
       {
           for(int j=1;j<=d;j++)
           {
               int x;
                cin>>x;
                vect[i].push_back(x);
           }
       }
  
     int count=0;
      for(int i=0;i<n;i++)
      {
          for(int j=i+1;j<n;j++)
          {
             long int sum=0;
              for(int k=0;k<d;k++)
           sum+=(vect[i][k]-vect[j][k])*(vect[i][k]-vect[j][k]); 
          }
            int last=sqrt(sum);
               if(sqrt(sum)==last)
                 count++;
      } 
    cout<<count;
}
         

Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: 'sum' was not declared in this scope
   28 |             int last=sqrt(sum);
      |                           ^~~
Language: C++

#include <bits/stdc++.h>
#include <conio.h>

using namespace std;

vector<int> points[50];


double distance( vector<int> & v1, vector<int> v2 ){

    double sum = 0;

    for( int i = 0; i < v1.size(); i++ ){
        sum += pow( ( v1[i] - v2[i] ), 2 );
    }

    return sqrt( sum );
}


bool comp( double num, double dis ){
    if( abs( num - dis  ) <= 0.0 ){
        return true;
    }

    return false;
}

int solve( int MAX ){

    int cont = 0;

    for( int i = 0; i < MAX; i++){
        for( int j = i + 1; j < MAX; j++ ){

            double dis = distance( points[ i ], points[ j ] );

            int up = (double) ceil( dis );

            int dow = (double)floor( dis );

            if( comp( up, dis ) || comp( dow, dis ) ){
                cont++;
            }

        }
    }
    return cont;

}

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

    //freopen( ".in", "r", stdin );

    int n, d;

    cin >>n >>d;

    int auxN = n;
    int auxD = d;

    int i = 0;

    while( n-- ){
        while( d -- ){
            int x;
            cin >>x;
            points[ i ].push_back( x );
        }
        d = auxD;
        i++;
    }

    cout <<solve( auxN );

    return 0;
}

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

#include <bits/stdc++.h>
#include <conio.h>

using namespace std;

vector<int> points[50];


double distance( vector<int> & v1, vector<int> v2 ){

    double sum = 0;

    for( int i = 0; i < v1.size(); i++ ){
        sum += pow( ( v1[i] - v2[i] ), 2 );
    }

    return sqrt( sum );
}


bool comp( double num, double dis ){
    if( abs( num - dis  ) <= 0.0 ){
        return true;
    }

    return false;
}

int solve( int MAX ){

    int cont = 0;

    for( int i = 0; i < MAX; i++){
        for( int j = i + 1; j < MAX; j++ ){

            double dis = distance( points[ i ], points[ j ] );

            int up = (double) ceil( dis );

            int dow = (double)floor( dis );

            if( comp( up, dis ) || comp( dow, dis ) ){
                cont++;
            }

        }
    }
    return cont;

}

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

    freopen( ".in", "r", stdin );

    int n, d;

    cin >>n >>d;

    int auxN = n;
    int auxD = d;

    int i = 0;

    while( n-- ){
        while( d -- ){
            int x;
            cin >>x;
            points[ i ].push_back( x );
        }
        d = auxD;
        i++;
    }

    cout <<solve( auxN );

    return 0;
}

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

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

int main()
{
  int n, d;
  cin >> n >> d;

  vector<vector<int>> p(n, vector<int>(d));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < d; j++) {
      cin >> p[i][j];
    }
  }

  vector<int> square(128)
  for (int i = 0; i < 128; i++) {
    square[i] = i * i;
  }

  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int x = 0;
      for (int k = 0; k < d; k++) {
        int t = p[i][k] - p[j][k];
        x += t * t;
      }
      if (find(begin(square), end(square), x) != end(square)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected ',' or ';' before 'for'
   17 |   for (int i = 0; i < 128; i++) {
      |   ^~~
a.cc:17:19: error: 'i' was not declared in this scope
   17 |   for (int i = 0; i < 128; i++) {
      |                   ^
Language: C

#include<stdio.h>


int D,N,n,d,x[100][100],q[110];
int uke(int x[100][100])
{
	scanf("%d%d",&N,&D);
	for(n=1;n<=N;n++){
		for(d=1;d<=D;d++){
			scanf("%d",&x[n][d]);
		}		
	}
	return x[n][d];
}
int y[30],p[30];
int sa(int y[30])
{	
	for(d=1;d<=D;d++){
		for(n=1;n<=N;n++){
			if (i == j) continue;
				q[n] = 0;
			for (int k = 0; k < d; k++) {
				q[n] += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
			}		
			
			
			
			/*y[d]=x[n][d]-x[n+1][d];
			
			p[d]=y[d]*y[d];
			q[n]=p[n]+p[n+1];
		}	
		y[d]=x[1][d]-x[N][d];
		p[d]=y[d]*y[d];
		q[n]=p[n]+p[n+1];*/
			
	}

	for(int x=0;x<20;x++){		
		if(q[n]==x*x){
			return 1;
		}
	}
}



int num=0;

int main()
{
	uke(x);
	sa(y);
	if(sa(y)){
		num++;
	}
	printf("%d\n",num);
	return 0;
}

	
	
	
	
	
	
	


Compiler output:
main.c: In function 'sa':
main.c:20:29: error: 'i' undeclared (first use in this function)
   20 |                         if (i == j) continue;
      |                             ^
main.c:20:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:34: error: 'j' undeclared (first use in this function)
   20 |                         if (i == j) continue;
      |                                  ^
main.c:59:1: error: expected declaration or statement at end of input
   59 | }
      | ^
Language: Java

public class Main {

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

        int n = scanner.nextInt();
        int d = scanner.nextInt();

        int[][] arr = new int[n][d];

        for (int i = 0; i < n; i++) {

            for (int j = 0; j < d; j++) {
                arr[i][j] = scanner.nextInt();
            }
        }

        int count = 0;
        for (int i = 0; i < n; i++) {

            for (int j = i + 1; j < n; j++) {

                int sum = 0;
                for (int k = 0; k < d; k++) {

                    int value = Math.abs(arr[i][k] - arr[j][k]);
                    sum += (value * value);
                }

                double sqrt = Math.sqrt(sum);
                if (sqrt == (int) (sqrt))
                    count++;
            }
        }

        System.out.println(count);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  int N, D;
  cin >> N >> D;
  int X[N][D];

  for (int k = 0; k < N; k++) {
    for (int l = 0; l < D; l++) {
      cin >> N[k][l];
    }
  }

  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      int diff = 0;
      for (int k = 0; k < D; k++) {
        int d = abs(X[i][j] - X[k][j]);
        diff += d * d;
      }

      bool f = false;
      for (int k = 0; k <= diff; k++) {
        if (k * k == diff) {
          f = true;
        }
      }
      if (f) ans++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: invalid types 'int[int]' for array subscript
   11 |       cin >> N[k][l];
      |               ^
Language: C++

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

int main(){
	int n,d;
	int i,j,k;
  	int x[n][d];

	cin >> n >> d;
	for(i=0; i<n; i++){
		for(j=0; j<d; j++){
			cin >> x[i][j];
		}
	}

	double t;
	int a=0;
	int count=0;

	for(i=1; i<n; i++){
	for(j=0; j<i; j++){
		for(k=0; k<d; k++){
			a = a + (x[i][k] - x[j][k])*(x[i][k] - x[j][k]);
		}
		t = sqrt(a);
		if(a == t*t){	//int型のaにぶち込むことで評価
			count++;
		}
	}
	}

	cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: 'sqrt' was not declared in this scope
   29 |                 t = sqrt(a);
      |                     ^~~~