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

#include<iostream>
using namespace std;
int main() {
	int n, d;
	cin >> n >> d;
	int count = 0;
	int buf[15][15];
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < d; j++) {
			cin >> buf[i][j];
		}
	}int sum = 1;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			int ans = 0;
			for (int k = 0; k < d; k++) {
				int a = (buf[i][k] - buf[j][k]) * (buf[i][k] - buf[j][k]);
				ans = ans + a;
			}
			int b = sqrt(ans);
			for (int x = 0; x <= b; x++) {
				if (x * x == ans) {
					count++;
				}
			}
		}
	}
	cout << count << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'sqrt' was not declared in this scope
   20 |                         int b = sqrt(ans);
      |                                 ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int count=0;
  int N,D;
  cin >> N >> D;
  vector<vector<int>> data(N, vector<int>(D));
  REP(i,N-1){
    REP(j,i+1,N){
      int sum=0;
      REP(k,D){
        sum += (data[i,k]-data[j,k])^2;
      }
      if(modf(sqrt(sum))==0) ++count;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc:16:16: error: macro "REP" passed 3 arguments, but takes just 2
   16 |     REP(j,i+1,N){
      |                ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i, n) for(int i = 0; i < n; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'REP' was not declared in this scope
   16 |     REP(j,i+1,N){
      |     ^~~
Language: C++

int main() {
  int N;
  int 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 count = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      int sum = 0;
      for (int d = 0; d < D; d++) {
        sum += pow(X[i][d] - X[j][d], 2);
      }
      float dist = sqrt(sum);
      if (dist == floor(dist)) count++;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> N >> D;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<vector<int>> X(N, vector<int> (D));
      |   ^~~~~~
a.cc:5:17: error: expected primary-expression before 'int'
    5 |   vector<vector<int>> X(N, vector<int> (D));
      |                 ^~~
a.cc:9:14: error: 'X' was not declared in this scope
    9 |       cin >> X[i][j];
      |              ^
a.cc:18:20: error: 'X' was not declared in this scope
   18 |         sum += pow(X[i][d] - X[j][d], 2);
      |                    ^
a.cc:18:16: error: 'pow' was not declared in this scope
   18 |         sum += pow(X[i][d] - X[j][d], 2);
      |                ^~~
a.cc:20:20: error: 'sqrt' was not declared in this scope
   20 |       float dist = sqrt(sum);
      |                    ^~~~
a.cc:21:19: error: 'floor' was not declared in this scope
   21 |       if (dist == floor(dist)) count++;
      |                   ^~~~~
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   24 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:24:20: error: 'endl' was not declared in this scope
   24 |   cout << count << endl;
      |                    ^~~~
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));
  vector<vector<int>> y(n, vector<int>(d));
  for(int i=0; i<n; i++){
    for(int j=0; j<d; j++){
      cin >> x.at(i).at(j);
      y.at(i).at(j) = x.at(i).at(j);
    }
  }
  int ans=0;
  for(int i=0; i<n; i++){
    for(int j=i+1; j<n; j++){
      double s;
      for(int k=0; k<d; k++){
        s += std::pow((x.at(i).at(k) - y.at(j).at(k)), 2.0);
      }
      s = std::pow(s, 0.5);
      if(is_interger(s)){
        ans++;
      }
      s=0;
    }
  }
  cout << ans << endl;
      
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: 'is_interger' was not declared in this scope
   23 |       if(is_interger(s)){
      |          ^~~~~~~~~~~
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));
  vector<vector<int>> y(n, vector<int>(d));
  for(int i=0; i<n; i++){
    for(int j=0; j<d; j++){
      cin >> x.at(i).at(j);
      y.at(i).at(j) = x.at(i).at(j);
    }
  }
  int ans=0;
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      double s;
      for(int k=0; k<d; k++){
        s += std::pow((x.at(i).at(k) - y.at(j).at(k)), 2.0);
      }
      s = std::pow(s, 0.5);
      if(s % 1 == 0){
        ans++;
      }
    }
  }
  cout << ans << endl;
      
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   23 |       if(s % 1 == 0){
      |          ~ ^ ~
      |          |   |
      |          |   int
      |          double
Language: C++

DSf;adhefireaij

Compiler output:
a.cc:1:1: error: 'DSf' does not name a type
    1 | DSf;adhefireaij
      | ^~~
a.cc:1:5: error: 'adhefireaij' does not name a type
    1 | DSf;adhefireaij
      |     ^~~~~~~~~~~
Language: C++

import math

N, D = map(int, input().split())
X = [[int(i) for i in input().split()] for i in range(N)]
ans = 0

for i in range(N):
    for j in range(i + 1, N):
        t = 0
        for k in range(D):
            t += (X[i][k] - X[j][k]) ** 2
        t = math.sqrt(t)
        if t.is_integer():
            ans += 1
print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      int tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(x[i][k] - x[j][k], 2);
      }
    }
    if(pow(sqrt(tmp),2) == tmp){
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   20 |     if(pow(sqrt(tmp),2) == tmp){
      |                 ^~~
      |                 tm
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      int tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(x[i][k] - x[j][k], 2);
      }
    }
  }
  double t = sqrt(tmp);
  if(int(t) == t){
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   21 |   double t = sqrt(tmp);
      |                   ^~~
      |                   tm
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      int tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(x[i][k] - x[j][k], 2);
      }
    }
    double t = sqrt(tmp);
    if(int(t) == t){
		cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   20 |     double t = sqrt(tmp);
      |                     ^~~
      |                     tm
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(x[i][k] - x[j][k], 2);
      }
    }
    double t = sqrt(tmp);
    if(int(t) == t){
		cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   15 |       tmp = 0;
      |       ^~~
      |       tm
a.cc:20:21: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   20 |     double t = sqrt(tmp);
      |                     ^~~
      |                     tm
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(a[i][k] - a[j][k], 2);
      }
    }
    double t = sqrt(tmp);
    if(int(t) == t){
		cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   15 |       tmp = 0;
      |       ^~~
      |       tm
a.cc:17:20: error: 'a' was not declared in this scope
   17 |         tmp += pow(a[i][k] - a[j][k], 2);
      |                    ^
a.cc:20:21: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   20 |     double t = sqrt(tmp);
      |                     ^~~
      |                     tm
Language: C++

#include<iosteram>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int cnt = 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-1; i++){
    for(int j=i+1; j<n; j++){
      tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(a[i][k] - a[j][k], 2);
      }
    }
    double t = sqrt(tmp);
    if(int(t) == t){
		cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

#include<iosteram>
#include<cmath>
using namespace std;
int main(){
  int n, d;
  int x[11][11];
  int min_=100000, min_i, min_j; 
  for(int i=0; i<n; i++){
    for(int j=0; j<d; j++){
      cin >> x[i][j];
    }
  }
  for(int i=0; i<n-1; i++){
    for(int j=i+1; j<n; j++){
      tmp = 0;
      for(int k=0; k<d; k++){
        tmp += pow(a[i][k] - a[j][k], 2);
      }
    }
    double t = sqrt(tmp);
    if(int(t) == t){
    	if(min_ < t){
        	min_i = i, min_j = j;	
        }
    }
  }
  cout << << endl;
  return 0;
}

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

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

bool is_integer( double x ){
  return std::floor(x)==x;
}

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

int n,d;
cin >> n >> d;
double x[10][10];
int i,j,k;
int ans=0;
for(i=0;i<n;++i){
    for(j=0;j<d;++j){
        cin >> x[i][j];
    }
}
double temp;
for(i=0;i<n;++i){
    for(j=0;j<n;++j){
        if(i>=j) break;
        for(k=0;k<d;++k){
            temp += pow(abs(x[i][k]-x[j][k]),2)
        }
        temp=sqrt(temp);
        if(is_integer(temp)) ans++;
    }
}
cout << ans << endl;
//////////////////////////////////////////////////////
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:48: error: expected ';' before '}' token
   28 |             temp += pow(abs(x[i][k]-x[j][k]),2)
      |                                                ^
      |                                                ;
   29 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std ;

int main(){
  int N,D,i,j,k,m,counter=0 ;
  int X[11][11] ;
  int Y[11][11] ;
  
  cin >> N >> D ;
  
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
      cin >> X[i][j] ;
      Y[i][j] = 0 ;
    }
  }
  
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      for(k=0;k<D;k++){
      	Y[i][j] += (X[i][k]-X[j][k])**2 ;
      }
      for(m=1;m < Y[i][j]/2;m++){
        if(Y[i][j] == m**2) counter++ ;
      }
    }
  }
          
  cout << counter ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: invalid type argument of unary '*' (have 'int')
   21 |         Y[i][j] += (X[i][k]-X[j][k])**2 ;
      |                                      ^~
a.cc:24:25: error: invalid type argument of unary '*' (have 'int')
   24 |         if(Y[i][j] == m**2) counter++ ;
      |                         ^~
Language: C++

#include <iostream>
using namespace std ;

int main(){
  int N,D,i,j,k,m,counter=0 ;
  int X[11][11] ;
  int Y[11][11] ;
  
  cin >> N >> D ;
  
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
      cin >> X[i][j] ;
      Y[i][j] = 0 ;
    }
  }
  
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      for(k=0;k<D;k++{
      	Y[i][j] += (X[i][k]-X[j][k])**2 ;
      }
      for(m=1;m < Y[i][j]/2;m++){
        if(Y[i][j] == m**2) counter++ ;
      }
    }
  }
          
  cout << counter ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: expected ')' before '{' token
   20 |       for(k=0;k<D;k++{
      |          ~           ^
      |                      )
a.cc:21:38: error: invalid type argument of unary '*' (have 'int')
   21 |         Y[i][j] += (X[i][k]-X[j][k])**2 ;
      |                                      ^~
a.cc:24:25: error: invalid type argument of unary '*' (have 'int')
   24 |         if(Y[i][j] == m**2) counter++ ;
      |                         ^~
Language: C++

#include <iostream>
using namespace std ;

int main(){
  int N,D,i,j,m,counter=0 ;
  int X[11][11] ;
  int Y[11][11] = 0 ;
  
  cin >> N >> D ;
  
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
      cin >> X[i][j] ;
    }
  }
  
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      for(k=0;k<D;k++{
      	Y[i][j] += (X[i][k]-X[j][k])**2 ;
      }
      for(m=1;m < Y[i][j]/2;m++){
        if(Y[i][j] == m**2) counter++ ;
      }
    }
  }
          
  cout << counter ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: array must be initialized with a brace-enclosed initializer
    7 |   int Y[11][11] = 0 ;
      |                   ^
a.cc:19:11: error: 'k' was not declared in this scope
   19 |       for(k=0;k<D;k++{
      |           ^
a.cc:19:22: error: expected ')' before '{' token
   19 |       for(k=0;k<D;k++{
      |          ~           ^
      |                      )
a.cc:20:38: error: invalid type argument of unary '*' (have 'int')
   20 |         Y[i][j] += (X[i][k]-X[j][k])**2 ;
      |                                      ^~
a.cc:23:25: error: invalid type argument of unary '*' (have 'int')
   23 |         if(Y[i][j] == m**2) counter++ ;
      |                         ^~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

	//for (auto v1 : v)
	//{
	//	for (auto v2 : v1)
	//	{
	//		cout << v2 << " ";
	//	}
	//	cout << endl;
	//}
	//system("pause");
	//return 0;

	int count = 0;
	for (int k = 0;k < n;k++)
		for (int i = k+1; i < n; i++)
		{
			float sum = 0;
			for (int j = 0; j < d; j++)
			{
				sum += pow(v[k][j] - v[i][j], 2);
			}
			float sq = sqrt(sum);
			if (sq = (int)sq)
				count++;
		}
	cout << count;

	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:40: error: 'pow' was not declared in this scope
   36 |                                 sum += pow(v[k][j] - v[i][j], 2);
      |                                        ^~~
a.cc:38:36: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   38 |                         float sq = sqrt(sum);
      |                                    ^~~~
      |                                    sq
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

int main() {
  int n,d,ans=0;
  cin>>n>>d;
  vector<vector<int>> v(n,vector<int>(d));
  rep(i,n) rep(j,d) cin>>v[i][j];
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      for(int k=0;k<d;k++){
        v[i][0]
      }
    }
  }
  
  
  
  
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: expected ';' before '}' token
   32 |         v[i][0]
      |                ^
      |                ;
   33 |       }
      |       ~         
a.cc:32:15: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   32 |         v[i][0]
      |               ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <cmath>
#include <iostream>
#include <string>

using namespace std;

int main(){
    int N, D, i, j, k, M=0;
    int x[20][10];
    double l, L;

    cin >> N >> D;

    for (i = 1; i <= N; i++) {
      for (j = 1; j <= D; j++) {
        cin >> x[i][j];
      }
    }

    for (i = 1; i <= N-1; i++) {
      for (j = i+1; j <= N; j++) {
        l = 0;
        for (k = 1; k <= D; k++) {
          l += pow(((x[i][k])-(x[j][k])), 2.0);
        }
        for (k = 1; k <= l; k++) {
          if(k*k == l){
            M++;
          }
        }
        }
      }
    }

    cout << M;


    return 0;
}


Compiler output:
a.cc:35:5: error: 'cout' does not name a type
   35 |     cout << M;
      |     ^~~~
a.cc:38:5: error: expected unqualified-id before 'return'
   38 |     return 0;
      |     ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
    int N, D, i, j, k, M=0;
    int x[20][10];
    double l, L;

    cin >> N >> D;

    for (i = 1; i <= N; i++) {
      for (j = 1; j <= D; j++) {
        cin >> x[i][j];
      }
    }

    for (i = 1; i <= N-1; i++) {
      for (j = i+1; j <= N; j++) {
        l = 0;
        for (k = 1; k <= D; k++) {
          l += pow(((x[i][k])-(x[j][k])), 2.0);
        }
        L = sqrt(l);
        if (L = floor(L)) {
          M++;
        }
      }
    }

    cout << M;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: 'pow' was not declared in this scope
   23 |           l += pow(((x[i][k])-(x[j][k])), 2.0);
      |                ^~~
a.cc:25:13: error: 'sqrt' was not declared in this scope
   25 |         L = sqrt(l);
      |             ^~~~
a.cc:26:17: error: 'floor' was not declared in this scope
   26 |         if (L = floor(L)) {
      |                 ^~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:32:5: error: expected declaration or statement at end of input
   32 |     return 0;
      |     ^~~~~~
Language: C

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

double distance(int i,int j)
{
    int k;
    double result=0;
    for(k=0; k<d; k++)
        result+=((a[i][k]-a[j][k])*(a[i][k]-a[j][k]));
    result=sqrt(result);
    return result;
}
int main()
{
    int n,i,j,c=0;
    int a[10][10],d;
    double ans;
    scanf("%d%d",&n,&d);
    for(i=0; i<n; i++)
        for(j=0; j<d; j++)
            scanf("%d",&a[i][j]);
    for(i=0; i<n-1; i++)
    {
        for(j=i+1; j<n; j++)
        {
            ans=distance(i,j);
            if(ans==(int)ans)
                c++;
        }
    }
    printf("%d",c);
    return 0;
}

Compiler output:
main.c: In function 'distance':
main.c:8:16: error: 'd' undeclared (first use in this function)
    8 |     for(k=0; k<d; k++)
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:19: error: 'a' undeclared (first use in this function)
    9 |         result+=((a[i][k]-a[j][k])*(a[i][k]-a[j][k]));
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int n, d;
nt a[30][30];
 
bool check(int u, int v) {
	int tmp = 0;
	for (int i = 1; i <= d; ++i) tmp += abs(a[u][i] - a[v][i]) * abs(a[u][i] - a[v][i]);
	return round(sqrt(tmp)) * round(sqrt(tmp)) == tmp;
}
 
int main() {
	cin >> n >> d;
	for (int i = 1; i <= n; ++i) 
		for (int j = 1; j <= d; ++j) 
			cin >> a[i][j];
	int cnt = 0;
	for (int i = 1; i <= n; ++i) 
		for (int j = i + 1; j <= n; ++j) 
			if (check(i, j)) ++cnt;
	cout << cnt << '\n';
	return 0;
}


Compiler output:
a.cc:5:1: error: 'nt' does not name a type; did you mean 'int'?
    5 | nt a[30][30];
      | ^~
      | int
a.cc: In function 'bool check(int, int)':
a.cc:9:49: error: 'a' was not declared in this scope
    9 |         for (int i = 1; i <= d; ++i) tmp += abs(a[u][i] - a[v][i]) * abs(a[u][i] - a[v][i]);
      |                                                 ^
a.cc: In function 'int main()':
a.cc:17:32: error: 'a' was not declared in this scope
   17 |                         cin >> a[i][j];
      |                                ^
Language: C++

#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e2 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N][N]
 
signed main() {
	IOS;
	#ifdef LOCAL
		freopen("input.txt","r", stdin);
		freopen("output.txt","w",stdout);
	#endif
	int n, d;
	cin >> n >> d;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= d; j++)
			cin >> a[i][j];
	}	
	int ans = 0;
	for(int i = 1; i <= n; i++){
		for(int j = i+1; j <= n; j++){
			int x = 0;
			for(int k = 1; k <= d; k++)
				x += (a[i][k] - a[j][k])*(a[i][k] - a[j][k]);
			int p = sqrt(x);
			if(p*p == x)
				ans++;
		}	
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc:22:1: error: expected initializer before 'signed'
   22 | signed main() {
      | ^~~~~~
Language: C++

#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
 
signed main() {
	IOS;
	#ifdef LOCAL
		freopen("input.txt","r", stdin);
		freopen("output.txt","w",stdout);
	#endif
	int n, d;
	cin >> n >> d;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= d; j++)
			cin >> a[i][j];
	}	
	int ans = 0;
	for(int i = 1; i <= n; i++){
		for(int j = i+1; j <= n; j++){
			int x = 0;
			for(int k = 1; k <= d; k++)
				x += (a[i][k] - a[j][k])*(a[i][k] - a[j][k]);
			int p = sqrt(x);
			if(p*p == x)
				ans++;
		}	
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:32: error: 'a' was not declared in this scope
   30 |                         cin >> a[i][j];
      |                                ^
a.cc:37:39: error: 'a' was not declared in this scope
   37 |                                 x += (a[i][k] - a[j][k])*(a[i][k] - a[j][k]);
      |                                       ^
Language: C++

#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<string,int> P;
int x[10][10];
int dist(int a,int b,int d)
{
	int ret=0;
	for(int i=0;i<d;i++)
		ret+=(x[a][i]-x[b][i])*(x[a][i]-x[b][i]);
	int sq=sqrt(ret);
	if(sq*sq==ret)
		return 1;
	else
		return 0;
}
int main()
{
	int n,d;
	cin>>n>>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++)
			ans+=dist(i,j,d);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int dist(int, int, int)':
a.cc:15:16: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   15 |         int sq=sqrt(ret);
      |                ^~~~
      |                sq
Language: C++

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

int main(void){
	int n, d;
	scanf("%d %d", &n, &d);
	int **x;
	x = malloc(sizeof(int*) * n);
	for(int i = 0; i < n; i++){
		x[i] = malloc(sizeof(int) * d);
		for(int j = 0; j < d; j++)
			scanf("%d", x[i] + j);
	}
	int count = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < i; j++){
			double res = 0;
			for(int k = 0; k < d; k++)
				res += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
			res = sqrt(res);
			if(res - (int)res <= 1e-6)count++;
		}
	}
	printf("%d\n", count);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: invalid conversion from 'void*' to 'int**' [-fpermissive]
    9 |         x = malloc(sizeof(int*) * n);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:11:30: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   11 |                 x[i] = malloc(sizeof(int) * d);
      |                        ~~~~~~^~~~~~~~~~~~~~~~~
      |                              |
      |                              void*
Language: C++

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

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))
#define endl '\n'

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define Pi 3.14159265358979
#define A first
#define B second

typedef long long ll;
typedef vector <int> vi;
typedef vector<ll> vl;
typedef pair <int, int> pi;
typedef pair <ll, int> pl;
typedef pair <ll, ll> pll;
typedef pair <double, double> pd;

//change these according to prob constraints
const int INF = 0x3f3f3f3f;
const int MAX = 100005;
const int MAX1 = 1005;
const int MAX2 = 105;
const int LEN = 105;
const int BASE = 1000000000;
const double EPS = 1e-7;
const int MOD = 1000000007;
//g++ -std=c++11 your_file.cpp -o your_program

ll mypow(ll a, ll b){
	ll ans=1;
	while(b){
		if(b&1)
			ans=(ans*a)%MOD;
		b/=2;
		a=(a*a)%MOD;
	}
	return ans;
}

int main(void){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ifstream in("");
	ofstream out("");
	clock_t begin = clock();
	int n, d;
  cin >>  n >> d;
  int arr[15][15]
  REP(i, n){
    REP(j, d){
      cin >> arr[i][j];
    }
  }
  int res = 0;
  REP(i, n - 1){
    FOR(j, i + 1, n){
      int sum = 0;
      REP(k, d){
        sum += (arr[i][k] - arr[j][k]) * (arr[i][k] - arr[j][k]);
      }
      if (sqrt(sum) * sqrt(sum) == sum){
        res++;
      }
    }
  }
  cout << res << endl;
	clock_t end = clock();
    double esecs = double(end - begin) / CLOCKS_PER_SEC;
    //cout << esecs << " seconds" << endl;
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:22: error: expected initializer before 'for'
    4 | #define FOR(i, a, b) for(int i = (a); i < (b); ++i)
      |                      ^~~
a.cc:6:19: note: in expansion of macro 'FOR'
    6 | #define REP(i, N) FOR(i, 0, N)
      |                   ^~~
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP(i, n){
      |   ^~~
a.cc:60:7: error: 'i' was not declared in this scope
   60 |   REP(i, n){
      |       ^
a.cc:4:39: note: in definition of macro 'FOR'
    4 | #define FOR(i, a, b) for(int i = (a); i < (b); ++i)
      |                                       ^
a.cc:60:3: note: in expansion of macro 'REP'
   60 |   REP(i, n){
      |   ^~~
a.cc:70:17: error: 'arr' was not declared in this scope
   70 |         sum += (arr[i][k] - arr[j][k]) * (arr[i][k] - arr[j][k]);
      |                 ^~~
Language: C++

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

int main(){
	int n, d;
	cin >> n >> d;
	int ans = 0;
	vector< vector<int>> a(n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < d; j++) {
			int h;
			cin >> h;
			a.at(i).push_back(h);
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = i+1; j < n; j++) {
			long double i_ = 0;
			for (int o = 0; o < d; o++) {
				i_ += pow((a.at(i).at(o) - a.at(j).at(o)), 2.0);
			}
			if (sqrt(i_) == int(sqrt(i_))) {
				ans++;
			}
		}
	}
	cout << ans;
};


Compiler output:
a.cc: In function 'int main()':
a.cc:25:39: error: 'pow' was not declared in this scope
   25 |                                 i_ += pow((a.at(i).at(o) - a.at(j).at(o)), 2.0);
      |                                       ^~~
a.cc:27:29: error: 'sqrt' was not declared in this scope
   27 |                         if (sqrt(i_) == int(sqrt(i_))) {
      |                             ^~~~
Language: C++


#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n, d;
	int a[10][10];
	cin >> n >> d;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < d; ++j) {
			cin >> a[i][j];
		}
	int g = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			int s = 0;
			for (int k = 0; k < d; ++k) {
				s += (a[i][k] - a[j][k])*(a[i][k] - a[j][k]);
			}
			double r = sqrt((double)s+0.00000001);
			if ((int)r*(int)r == s) ++g;
		}
	}
	cout << g;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:36: error: 'sqrt' was not declared in this scope
   21 |                         double r = sqrt((double)s+0.00000001);
      |                                    ^~~~
Language: C++

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

int arr[10][10];
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected ';' before '}' token
   18 |      cout<<arr[i][j]
      |                     ^
      |                     ;
   19 |    }
      |    ~
Language: Java

import java.util.*;
import java.lang.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int d = scan.nextInt();
      	int[][] x = new int[n][d];
      	int counter =0;
      for(int j = 0 ; j < n; j ++){
      	for(int i = 0; i < d; i ++){
       		x[j][i] = scan.nextInt(); 	
        }
      }
      for(int i = 0; i < n - 1 ; i ++){
        int sum = 0; 
      	for(int j = i + 1; j < n ; j ++){
          for(int k = 0; k < d; k ++){
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          }
          if(Math.sqrt(sum) == (int)(Math.sqrt(sum))){
          	counter++;
          }
        }
      }
      System.out.print(counter);
    }	
 
}

Compiler output:
Main.java:20: error: bad operand types for binary operator '*'
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          	             ^
  first type:  int[]
  second type: int[]
Main.java:20: error: bad operand types for binary operator '*'
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          	                         ^
  first type:  int[]
  second type: int[]
Main.java:20: error: bad operand types for binary operator '*'
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          	                                       ^
  first type:  int[]
  second type: int[]
Main.java:20: error: bad operand types for binary operator '*'
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          	                                                   ^
  first type:  int[]
  second type: int[]
4 errors
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int d = scan.nextInt();
      	int[][] x = new int[n][d];
      	int counter =0;
      for(int j = 0 ; j < n; j ++){
      	for(int i = 0; i < d; i ++){
       		x[j][i] = scan.nextInt(); 	
        }
      }
      for(int i = 0; i < n - 1 ; i ++){
        int sum = 0; 
      	for(int j = i + 1; j < n ; j ++){
          for(int k = 0; k < d; k ++){
          	sum += ((x[j]*x[i] - x[i]*x[i]) * (x[j]*x[i] - x[i]*x[i]));
          }
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
          	counter++;
          }
        }
      }
      System.out.print(counter);
    }	
 
}

Compiler output:
Main.java:21: error: '.class' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                  ^
Main.java:21: error: ';' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                                  ^
2 errors
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int d = scan.nextInt();
      	int[][] x = new int[n][d];
      	int counter =0;
      for(int j = 0 ; j < n; j ++){
      	for(int i = 0; i < d; i ++){
       		x[j][i] = scan.nextInt(); 	
        }
      }
      for(int i = 0; i < n - 1 ; i ++){
        int sum = 0; 
      	for(int j = i + 1; j < n ; j ++){
          for(int k = 0; k < d; k ++){
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          }
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
          	counter++;
          }
        }
      }
      System.out.print(counter);
    }	
 
}

Compiler output:
Main.java:19: error: ')' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	             ^
Main.java:19: error: not a statement
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                  ^
Main.java:19: error: ';' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                        ^
Main.java:19: error: not a statement
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                         ^
Main.java:19: error: ';' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                            ^
Main.java:19: error: not a statement
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                  ^
Main.java:19: error: ';' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                     ^
Main.java:19: error: not a statement
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                          ^
Main.java:19: error: ';' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                                ^
Main.java:19: error: not a statement
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                                 ^
Main.java:19: error: ';' expected
          	sum += ((x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]));
          	                                                    ^
Main.java:21: error: '.class' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                  ^
Main.java:21: error: ';' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                                  ^
13 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int d = scan.nextInt();
      	int[][] x = new int[n][d];
      	int counter =0;
      for(int j = 0 ; j < n; j ++){
      	for(int i = 0; i < d; i ++){
       		x[j][i] = scan.nextInt(); 	
        }
      }
      for(int i = 0; i < n - 1 ; i ++){
        int sum = 0; 
      	for(int j = i + 1; j < n ; j ++){
          for(int k = 0; k < d; k ++){
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          }
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
          	counter++;
          }
        }
      }
    }	

}

Compiler output:
Main.java:19: error: ')' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	            ^
Main.java:19: error: not a statement
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                 ^
Main.java:19: error: ';' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                       ^
Main.java:19: error: not a statement
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                        ^
Main.java:19: error: ';' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                           ^
Main.java:19: error: not a statement
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                 ^
Main.java:19: error: ';' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                    ^
Main.java:19: error: not a statement
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                         ^
Main.java:19: error: ';' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                               ^
Main.java:19: error: not a statement
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                                ^
Main.java:19: error: ';' expected
          	sum += (x[j]x[i] - x[i]x[i]) * (x[j]x[i] - x[i]x[i]);
          	                                                   ^
Main.java:21: error: '.class' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                  ^
Main.java:21: error: ';' expected
          if(Math.sqrt(sum) == int(Math.sqrt(sum))){
                                                  ^
13 errors
Language: C++

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

int main(){
	int n, d;
	cin >> n >> d;
	vector<vector<int>>x(n, vector<int>(d));
	rep(i, n){
		rep(j, d){
			cin >> v[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 = sqrt(sq) + 0.5;
			if(s * s == sq){
				ans++;
			}
		}
	}
	cout << ans << endl;
	
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: 'v' was not declared in this scope
   11 |                         cin >> v[i][j];
      |                                ^
Language: C

#include <stdio.h>
#include <math.h>
#include <stdbool.h>
//----//
#define MX 10
int n, d;


int main(){
  int i, j, k, data, count;
  int X[MX][MX];
  scanf("%d%d", &n, &d);
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
		scanf("%d", &X[i][j]);
    }
  }
 //--//
  count = 0;
  data = 0;
  for(i=0;i<N;++i){
    for(j=i+1;j<N;++j){
      	data = 0;
		for(k=0;k<D;++k){
          data += pow(fabs(X[i][k] - X[j][k]), 2);
        }
    	for(k=0;k<data;k++){
          if(pow(k,2) == data){
            count++;
        }
    }
  }
  printf("%d",count);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:13: error: 'N' undeclared (first use in this function)
   13 |   for(i=0;i<N;i++){
      |             ^
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:15: error: 'D' undeclared (first use in this function)
   14 |     for(j=0;j<D;j++){
      |               ^
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C++

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

int main(){
  int n, d;
  cin >> n >> d;
  vector<vector<int>> vec(n, vector<int>(10));
  rep(i,n){
    rep(j,d) cin >> vec.at(i).at(j);
  }
  int cnt=0;
  rep(i,n){
    for (j=i+1;j<n;j++){
      int tmp=0;
      if (i==j) continue;
      rep(k,d) tmp += pow((vec.at(i).at(k)-vec.at(j).at(k)),2);
      rep(l,tmp){
        if (l*l==tmp) cnt++;
      }
    }
  }
  cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'j' was not declared in this scope
   14 |     for (j=i+1;j<n;j++){
      |          ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(){
    int N , D;
    vector<vector<int>> x(N, vector<int>(D));
    rep(i,N){
        rep(j,D) cin >> x.at(i).at(j);
    }
    int ans = 0;
    rep(i,N) rep(j,i){// j < i
      int sq = 0;
      rep(k,D){
          int s = x.at(i).t(k)-x.at(j).at(k);
          sq = s * s;

      }
      int s = sqrt(sq) + 0.5
      if(s * s == sq) 
      ans++;
      }
      cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 't'; did you mean 'at'?
   14 |           int s = x.at(i).t(k)-x.at(j).at(k);
      |                           ^
      |                           at
a.cc:19:7: error: expected ',' or ';' before 'if'
   19 |       if(s * s == sq)
      |       ^~
Language: C++

//templates
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <unordered_map>
#include <map>
#include <cmath>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SZ(x) ((int)(x).size())
typedef long long ll;
using namespace std;

//main
int main(){
  int N,D;
  cin >> N >> D;
  vector<vector<int>>　v(N,vector<int> (D));
  rep(i,N) rep(j,D) cin >> v[i][j];
}


Compiler output:
a.cc:21:22: error: extended character 　 is not valid in an identifier
   21 |   vector<vector<int>>　v(N,vector<int> (D));
      |                      ^
a.cc: In function 'int main()':
a.cc:22:28: error: 'v' was not declared in this scope
   22 |   rep(i,N) rep(j,D) cin >> v[i][j];
      |                            ^
Language: C++

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

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 count = 0;
  for (int i = 0; i < n -1; i++) {
    for (int j = i + 1; j < n; j++) {
      int distance2 = 0;
      for (int k = 0; k< d;k++) {
        int m_s_distance1 = x.at(j).at(k) - x.at(i).at(k);
        distance2 += m_s_distance1 * m_s_distance1;
      }
      for (int k = 0; k <= m_s_distance1;k++) {
        if (m_s_distance1*m_s_distance1 == k*k){
          count++;
        }
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: 'm_s_distance1' was not declared in this scope; did you mean 'distance2'?
   24 |       for (int k = 0; k <= m_s_distance1;k++) {
      |                            ^~~~~~~~~~~~~
      |                            distance2
Language: C

#include <stdio.h>
#include <math.h>
int main (void){
int n,d;
scanf("%d%d",&n,&d);
int e=0;
int a[100][100];
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;i++){
    int b=0;
    int c;
    for(int j=0;j<d;j++){
        if(i==n-1){
            b=b+(a[i][j]-a[0][j])*(a[i][j]-a[0][j]);
        }else{
    b=b+(a[i][j]-a[i+1][j])*(a[i][j]-a[i+1][j]);
        }
    printf("%d\n",b);
    }
    c=sqrt(b);
    if(c*c==b){
        e++;
    }
}
printf("%d",e);
retu

Compiler output:
main.c: In function 'main':
main.c:30:1: error: 'retu' undeclared (first use in this function)
   30 | retu
      | ^~~~
main.c:30:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:5: error: expected ';' at end of input
   30 | retu
      |     ^
      |     ;
main.c:30:1: error: expected declaration or statement at end of input
   30 | retu
      | ^~~~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
void solve()
{
int n,d;
  cin>>n>>d;
  int a[n][d];
  for(int i=0; i<n; i++){
  for(int j=0; j<d; j++){
  cin>>a[i][j];
  }
  }
int total=0;
  float ans=0;
  for(int i1=0; i<n; i++){
  for(int i2=i1+1; i2<n; i2++){
ans=0;
    for(int j1=0; j1<d; j1++){
  ans+=pow(abs(a[i1][j1]-a[i2][j1]),2);
  }
  }
  int k;
    k=static_cast<int>(ans);
    k=sqrt(k);
    if(pow(k,2)==ans){total++;}
  }
cout<<total;
}
 

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:16:17: error: 'i' was not declared in this scope; did you mean 'i1'?
   16 |   for(int i1=0; i<n; i++){
      |                 ^
      |                 i1
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
void solve()
{
int n,d;
  cin>>n>>d;
  int a[n][d];
  for(int i=0; i<n; i++){
  for(int j=0; j<d; j++){
  cin>>a[i][j];
  }
  }
int total=0;
  for(int i1=0; i<n; i++){
  for(int i2=i1+1; i2<n; i2++){
  float ans=0;
    for(int j1=0; j<d; j++){
  ans+=pow(abs(a[i1][j1]-a[i2][j1]),2);
  }
  }
  int k;
    k=static_cast<int>(ans);
    k=sqrt(k);
    if(pow(k,2)==ans){total++;}
  }
cout<<total;
}
 

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:15:17: error: 'i' was not declared in this scope; did you mean 'i1'?
   15 |   for(int i1=0; i<n; i++){
      |                 ^
      |                 i1
a.cc:18:19: error: 'j' was not declared in this scope; did you mean 'j1'?
   18 |     for(int j1=0; j<d; j++){
      |                   ^
      |                   j1
a.cc:23:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     k=static_cast<int>(ans);
      |                        ^~~
      |                        abs