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

#define _GLIBCXX_DEBUG
#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-1;i++){
        for(int j = i+1;j < N;j++){
            int dd = 0;
            for(int k = 0;k < D;k++){
                dd += pow(X[i][k]-X[j][k], 2.0);
            }
            bool flag = false;
            for(int l = 0;l <= dd;l++){
                if(l * l == dd){
                    flag = true;
                }
            }
            if(flag) ans++;
        }
    }
    cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: expected '}' at end of input
   30 |     cout << ans << endl;
      |                         ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main() {
  int n, d;
  cin >> n >> d;
  int x[n][d];
  for(int i = 0; i < n; i++){
    for(int j = 0; j < d; j++){
      cin >> x[i][d];
    }
  }
  
  for(int i = 0; i < n - 1; i++){
    for(int j = i; j < n; j++){
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:14:33: note: to match this '{'
   14 |   for(int i = 0; i < n - 1; i++){
      |                                 ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int n,d;
cin >> n >> d;
int x[n][d];
REP(i,n) {
  REP(j,d) {
    cin >> x[i][j];
  }
}
int ans=0;
REP(i,n-1) {
  for(int j=i+1;j<n;j++) {
    sum =0;
    REP(k,d) {
      sum+=pow((x[i][k]-x[j][k]),2);
    }
    REP(l,130) {
      if(sum%l==0&&sum/l==l) ans++;
    }
  }
}
return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
#define fin(ans) cout << (ans) << endl;

template <typename T>
void VV(T &n, ll size)
{
  for (ll i = 0; i < n.size(); i++)
  {
    for (ll j = 0; j < size; j++)
    {
      cin >> n[i][j];
    }
  }
}

ll modpow(ll x, ll n, ll mod = MAX)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1)
      res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}

void Main()
{
  ll n, d;
  cin >> n >> d;
  vvll x(n, vll (d));
  VV(x, d);
  ll flag = 0;
  for(ll i = 0;i < n - 1;i++)
  {
    for(ll j = i + 1;j < n;j++)
    {
      ll ans = 0;
      for(ll k = 0;k < d;k++)
      {
        ans += modpow((x[i][k]-x[j][k]), 2);
      }
      if(ans == sqrt(ans) * sqrt(ans)) flag++;
    }
  }
  fin(flag)
  return;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

Compiler output:
a.cc:22:32: error: 'MAX' was not declared in this scope
   22 | ll modpow(ll x, ll n, ll mod = MAX)
      |                                ^~~
Language: C++

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  double n,d;
  vvl x(n,vl (d));
  rep(i,n){
    rep(j,d)cin>>x[i][j];
  }
  ll count=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      double ans=0;
      for(int k=0;k<d;k++){
        ans+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k])
      }
      ans=sqrt(ans);
      ll ansll=ans;
      if(ansll==ans)count++;
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:49: error: expected ';' before '}' token
   27 |         ans+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k])
      |                                                 ^
      |                                                 ;
   28 |       }
      |       ~
Language: C++

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

int main()
{
  int n, d ;
  cin >> n >> d  ;
  
  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++){
    double distance = 0.0 ;
      for(int j=0; j<d; j++){
    if(i==n) 
      distance += sqrt(abs(x[0][j]-x[i-1][j])*abs(x[0][j]-x[i-1][j]));
    else 
      distance += sqrt(abs(x[i][j]-x[i+1][j])*abs(x[i][j]-x[i+1][j]));
    }
    if(distance%1==0) 
      count++ ;
  }
 cout << count << endl ;
  
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; cin>>n;
  int d; cin>>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-1){
    for(int j=i+1;j<n;j++){
      int num=0;
      rep(k,d) num+=(X.at(i).at(k)-X.at(j).at(k))*(X.at(i).at(k)-X.at(j).at(k));
      if(num==sqrt(num)*sqrt(num)) ans++:
    }
  }
  cout<<ans<<endl;      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: expected ';' before ':' token
   16 |       if(num==sqrt(num)*sqrt(num)) ans++:
      |                                         ^
      |                                         ;
Language: C++

#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
    cin >> first;
    IN(rest...);
    return;
}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

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

 int main(){
     SS(int,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 sum = 0;
             for(int k=0;k<D;k++) {
                 sum += (x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
             
             for(int k=1;k*k<=sum;k++) {
                 if(k*k==sum) {
                     ans++;
                     break;
                 }
             }
         }
     }
     cout << ans << endl;
 }

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

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

bool f(vector<int>& a, vector<int>& b) 
{
	long long s = 0;
	for (int i = 0; i < a.size(); ++i) {
		s += (b[i] - a[i]) * (b[i] - a[i]);
	}

	long long t = sqrt(s);
	return (s == t * t) || (s == (t+1) * (t+1));
}

int main() 
{
	int n, d;
	cin >> n >> d;
	vector<vector<int>> xv(n, vector<int>(d));
	for (auto& i : xv) {
		for (auto& j : i) {
			cin >> j;
		}
	}

	int ret = 0;
	for (int i = 0; i < n - 1; ++i) {
		for (int j = i; j < n; ++j) {
			if (f(i, j)) {
				++ret;
			}
		}
	}

	cout << ret << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'int'
   31 |                         if (f(i, j)) {
      |                               ^
a.cc:6:21: note: in passing argument 1 of 'bool f(std::vector<int>&, std::vector<int>&)'
    6 | bool f(vector<int>& a, vector<int>& b)
      |        ~~~~~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define cout(n) cout << fixed << setprecision(n)

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

ll dist2(vector<ll> &y, vector<ll> &z) {
  ll sum = 0;
  rep(i, y.size()) {
    sum += (y[i] - z[i]) * (y[i] - z[i]);
  }
  return sum;
}

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

  ll n, d;
  cin >> n >> d;

  vector<vector<ll>> x(n, vector<ll>(d));
  rep(i, n) {
    rep(j, d) {
      cin >> x[i][j];
    }
  }
  ll ans = 0;
  rep(y, n - 1) {
    FOR(z, y + 1, n) {
      double d = sqrt(dist2(x[y], x[z]));
      if (d2 == (ll)d2) {
        ans++;
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:11: error: 'd2' was not declared in this scope; did you mean 'd'?
   65 |       if (d2 == (ll)d2) {
      |           ^~
      |           d
Language: C++

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

 int main() {
   int N, D;
   int X[20][20];
   cin >> N >> D;
   for (size_t i = 0; i < N; i++) {
     for (size_t j = 0; j < D; j++) {
       cin >> X[i][j];
     }
   }
 int res = 0;
   for (size_t i = 0; i < N - 1; i++) {
     for (size_t j = i+1 ; i < N; i++) {
       int a = 0;

       for (size_t k = 0; k < D; k++) {
         int diff =  abs(X[j][k] - X [i][k])
         a += diff * diff;
       }
       bool flag = false;
       for (size_t k = 0; k <= a; k++) {
         if (k * k == a) {
           flag = true;
         }
       }
       if (flag) {
         res++;
       }
     }
   }
   cout << res << '\n';
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected ',' or ';' before 'a'
   20 |          a += diff * diff;
      |          ^
Language: C++

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

 int main() {
   int N, D;
   int X[20][20];
   cin >> N >> D;
   for (size_t i = 0; i < N; i++) {
     for (size_t j = 0; j < D; j++) {
       cin >> X[i][j];
     }
   }
 int res = 0;
   for (size_t i = 0; i < N - 1; i++) {
     for (size_t j = i+1 ; i < N; i++) {
       int a = 0;

       for (size_t k = 0; k < D; k++) {
         int diff =  abs(X[j][k] - X [i][k])
         a += diff * diff
       }
       bool flag = false;
       for (size_t k = 0; k <= a; k++) {
         if (k * k == a) {
           flag = true;
         }
       }
       if (flag) {
         res++
       }
     }
   }
   cout << res << '\n';
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected ',' or ';' before 'a'
   20 |          a += diff * diff
      |          ^
a.cc:29:15: error: expected ';' before '}' token
   29 |          res++
      |               ^
      |               ;
   30 |        }
      |        ~
Language: C++

import numpy
N, D = map(int, input().split())
listX = []

for i in range(N):
    x = list(map(int, input().split()))
    listX.append(x)

cnt = 0
for i in range(N):
    for j in range(N):
        if i<j:
            u = numpy.array(listX[i]) - numpy.array(listX[j])
            distance = numpy.linalg.norm(u)
            if distance.is_integer():
                cnt += 1
                
print(cnt)

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

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

int main(){
  int n, d;
  std::cin >> n >> d;
  std::vector<std::vector<double>> x;
  std::vector<double> temp;
  double input;
  for(int i=0; i<n; ++i){
  	for(int j=0; j<d; ++j){
      std::cin >> input;
  	  temp.push_back(input);
    }
  x.push_back(temp);
  }
  std::vector<double> distance;
  for(int i=0; i<n-1; ++i)
    for(int j=i; j<n; ++j){
      double temp = 0;
      for(int k=0; k<d; ++k)
        temp += pow(x[i][k]-x[j][k],2);
      distance.push_back(sqrt(temp));
    }
  int cnt = 0;
  for(auto i : distance)
    double err = i-round(i);
    if(err<-0.000001 && 0.000001<err)
      ++cnt;
  std::cout << cnt << std::endl;
  return 0;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'err' was not declared in this scope; did you mean 'erf'?
   29 |     if(err<-0.000001 && 0.000001<err)
      |        ^~~
      |        erf
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n,d;
  cin>>n>>d;
  vector<vector<double>> t(n,vector<double>(d));
  rep(i,n)rep(j,d) cin>>t[i][j];
  ll ans=0;
  rep(i,n){
    
   for(int j=i+1;j<nj++){
     double s=0;
     double h=0;
     rep(u,d){
       h+=(t[i][d]-t[j][d])*(t[i][d]-t[j][d]);
     }
     s=sqrt(h);
     if(s%1.0==0) ans++;
  }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: 'nj' was not declared in this scope; did you mean 'j'?
   46 |    for(int j=i+1;j<nj++){
      |                    ^~
      |                    j
a.cc:46:24: error: expected ';' before ')' token
   46 |    for(int j=i+1;j<nj++){
      |                        ^
      |                        ;
a.cc:53:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   53 |      if(s%1.0==0) ans++;
      |         ~^~~~
      |         | |
      |         | double
      |         double
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <numeric>
#include <unordered_map>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory>
#include <iomanip>
#include <type_traits>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
constexpr long long MOD = 1e9 + 7;
constexpr long long MAX = 1000000;

//long long MOD = 998244353;
constexpr ll INF = 1e17;
constexpr double PI = 3.141592653589793;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }



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

    int n, d;
    cin >> n >> d;
    vector<vector<double>> x(n, vector<double>(d));

    for (auto& row : x) {
        for (auto& e : row) {
            cin >> e;
        }
    }

    auto isInteger = [](double x) -> bool {
        return std::floor(x) == x;
    };

    int cnt = 0;
    for (size_t j = 0; j < n; ++j)
    {
        for (size_t i = 0; i < j; ++i)
        {
            double acc = 0.0;
            for (size_t k = 0; k < d; ++k)
            {
                acc += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
            }
            double distance = std::sqrt(acc);
            if (isInteger(distance)
                && (fabs(acc) > DBL_EPSILON)
                )
            {
                cnt++;
            }
        }
    }

    cout << cnt << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:62:33: error: 'DBL_EPSILON' was not declared in this scope
   62 |                 && (fabs(acc) > DBL_EPSILON)
      |                                 ^~~~~~~~~~~
Language: C++

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

int distance(vector<int> a, vector<int> b) {
  int d = 0;
  for(int i=0; i<a.size(); i++) {
    d += (a.at(i) - b.at(i)) * (a.at(i) - b.at(i));
  }
  return d;
}

int main() {
  int n, d;
  cin >> n >> d;
  vector<vector<int>> x(n,vector<int>(n));
  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; j<n; j++) {
      int d = distance(x.at(i), x.at(j));
      for(int k=1; k*k<=d; k++) {
        if(k*k == d)
          count++;
      }
    }
  }
  
  cout << count << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: expected '}' at end of input
   33 |   cout << count << endl;
      |                         ^
a.cc:12:12: note: to match this '{'
   12 | int main() {
      |            ^
Language: C++

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

int main(){
	int N, D;
	cin >> N >> D;
	
	vector<vector<int>> data(N, vector<int>(D));
	for(int i=0;i<D;i++){
		for(int j=0;j<N;j++){
			cin >> data.at(i).at(j);
		}
	}
	int sum=0, ans=0;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			for(int k=0;k<D;k++){
				if(i!=j){
					sum = (vec.at(i).at(k)-vec.at(j).at(k))*(vec.at(i).at(k)-vec.at(j).at(k));
				}
			}
			double dis = sqrt(sum);
			if (int(dis)-dis==0){
				ans++;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:48: error: 'vec' was not declared in this scope
   19 |                                         sum = (vec.at(i).at(k)-vec.at(j).at(k))*(vec.at(i).at(k)-vec.at(j).at(k));
      |                                                ^~~
Language: C++

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

int main(){
	int N, D;
	cin >> N >> D;
	
	vector<vector<int>> data(N, vector<int>(D));
	for(int i=0;i<D;i++){
		for(int j=0;j<N;j++){
			cin >> data.at(i).at(j);
		}
	}
	int sum=0, ans=0;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			for(int k=0;k<D;k++){
				if(i!=j){
					sum = (vec.at(i).at(k)-vec.at(j).at(k))*(vec.at(i).at(k)-vec.at(j).at(k));
				}
			}
			double dis = sqrt(sum);
			if (int(dis)-dis==0){
				ans++
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:48: error: 'vec' was not declared in this scope
   19 |                                         sum = (vec.at(i).at(k)-vec.at(j).at(k))*(vec.at(i).at(k)-vec.at(j).at(k));
      |                                                ^~~
a.cc:24:38: error: expected ';' before '}' token
   24 |                                 ans++
      |                                      ^
      |                                      ;
   25 |                         }
      |                         ~
Language: C++

N, D = map(int, input().split())
A = []
for i in range(N):
    x = list(map(int, input().split()))
    A.append(x)

def check(x, y):
    s = 0
    for a, b in zip(x, y): s += (a - b) ** 2

    for i in range(0, s+1):
        if i * i == s: return 1
    return 0


ans = 0
for i in range(N):
    for j in range(i+1, N): ans += check(A[i], A[j])
print(ans)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, D = map(int, input().split())
      | ^
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 z=0;z<D;z++){
            cin >> X[i][z]
        }
    }
    int ans =0;
      for(int i=0;i<N;i++){
        for(int z=i+1;z<N;z++){
            int norm=0;
            for(int k=0;k<D;k++){
                int diff = abs(X[i][k] - X[z][k]);
                norm = diff * diff;     
            }
            bool fiag = false;
            for(int k=0;k<norm;k++){
                if(k*k==norm)
                ans++;
            } 
        }

    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: expected ';' before '}' token
    8 |             cin >> X[i][z]
      |                           ^
      |                           ;
    9 |         }
      |         ~
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 z=0;z<D;z++){
            cin >> X[i][z]
        }
    }
    int ans =0;
      for(int i=0;i<N;i++){
        for(int z=i+1;z<N;z++){
            int norm=0;
            for(int k=0;k<D;k++){
                int diff = abs(X[i][k] - X[z][k]);
                norm = diff * diff;     
            }
            bool fiag = false;
            for(int k=0;k<norm;k++){
                if(k*k==norm)
                ans++;
            } 
        }

    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:43: error: expected ')' before ';' token
    5 |     vector<vector<int>> X(N,vector<int>(D););
      |                          ~                ^
      |                                           )
a.cc:5:44: error: expected primary-expression before ')' token
    5 |     vector<vector<int>> X(N,vector<int>(D););
      |                                            ^
a.cc:8:27: error: expected ';' before '}' token
    8 |             cin >> X[i][z]
      |                           ^
      |                           ;
    9 |         }
      |         ~
Language: C++

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

using namespace std;

bool isqrt(unsigned long long x) {
	long long y = sqrt(x);
	if (y*y == x) return true;
	return false;
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, d; cin >> n >> d;

	int arr[11][21];

	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= d; ++j) cin >> arr[i][j];
	}


	int ans = 0;
	for (int i = 1; i < n; ++i) {
		for (int j = i + 1; j <= n; ++j) {
			unsigned long long dis2 = 0;
			for (int k = 1; k <= d; ++k) {
				dis2 += ((arr[i][k] - arr[j][k])*(arr[i][k] - arr[j][k]));
			}
			if (isqrt(dis2)) {
				++ans;
			}
		}
	}

	cout << ans << "\n";
	
	
	return 0;
}

Compiler output:
a.cc: In function 'bool isqrt(long long unsigned int)':
a.cc:9:23: error: 'sqrt' was not declared in this scope; did you mean 'isqrt'?
    9 |         long long y = sqrt(x);
      |                       ^~~~
      |                       isqrt
Language: C++

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

int main() {
  int N, D, X[10][10];
  int num = 0;
  cin >> N >> D;
  for(int i=1; i<=N; i++) {
    for(int j=0; j<=D; j++)
      cin >> X[i][j];
  }
  for(int n=1; n<=N; n++) {
    for(int i=1; i<=N; i++) {
      int a=0;
      for(int j=1; j<=D; j++) {
	a += (X[n][j]-X[i][j])*(X[n][j]-X[i][j]);
      }
      int temp = sqrt(a);
      if(temp*temp==a)
	ans++;
    }
  }

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




Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         ans++;
      |         ^~~
      |         abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

int main() {
  int N, D, X[10][10];
  int num = 0;
  cin >> N >> D;
  for(int i=1; i<=N; i++) {
    for(int i=0; j<=D; j++)
      cin >> X[i][j];
  }
  for(int n=1; n<=N; n++) {
    for(int i=1; i<=N; i++) {
      int a=0;
      for(int j=1; j<=D; j++) {
	a += (X[n][j]-X[i][j])*(X[n][j]-X[i][j]);
      }
      int temp = sqrt(a);
      if(temp*temp==a)
	ans++;
    }
  }

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



Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'j' was not declared in this scope
    9 |     for(int i=0; j<=D; j++)
      |                  ^
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         ans++;
      |         ^~~
      |         abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long

double dist(vector<ll> a, vector<ll> b) {
  ll c = 0;
  for (ll i = 0; i < a.size(); i++) c+=(a[i]-b[i])*(a[i]-b[i]);
  return sqrt(c);
}

int main() {
  ll N,D, ans=0;
  cin >> N >> D;
  vector<ll> vec(D)
  vector<vector<ll>> mat(N,vec);
  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < D; j++) cin >> (mat[i])[j];
  }
  
  for (ll i = 0; i < N-1; i++) {
  	vector<ll> v1 = mat[i];
    for (ll j = i+1; j < N; j++) {
      vector<ll> v2 = mat[j];
      double d = dist(v1,v2);
      int d_int = round(d);
      if (abs(d-d_int) < 1e-8) ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'vector'
   16 |   vector<vector<ll>> mat(N,vec);
      |   ^~~~~~
a.cc:18:40: error: 'mat' was not declared in this scope
   18 |     for (ll j = 0; j < D; j++) cin >> (mat[i])[j];
      |                                        ^~~
a.cc:22:25: error: 'mat' was not declared in this scope
   22 |         vector<ll> v1 = mat[i];
      |                         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int q[1000][1000];
signed main(){
  int a,b,n=0,d,f=0;
  int c;
  cin>>a>>b;
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
      cin>>q[i][j];
    }
  }
  for(int i=0;i<a;i++){
    for(int j=0;j<a-1;j++){
      for(int k=0;k<b;k++){
        
      }
    }
  }

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

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

long double dist(int i, int j, vector<vector<int>> p) {
  long long sum = 0;
  for (int k = 0; i < d; i++)
    sum += pow(p.at(i).at(k) - p.at(j).at(k), 2);
  return sqrt(sum);
}

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.at(i).at(j);
  int cnt = 0;
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      if (dist(i, j, p) == (int)dist(i, j, p)) cnt++;
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'long double dist(int, int, std::vector<std::vector<int> >)':
a.cc:6:23: error: 'd' was not declared in this scope
    6 |   for (int k = 0; i < d; i++)
      |                       ^
Language: C++

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

long double d(int i, int j, vector<vector<int>> p) {
  long long sum = 0;
  for (int k = 0; i < d; i++)
    sum += pow(p.at(i).at(k) - p.at(j).at(k), 2);
  return sqrt(sum);
}

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.at(i).at(j);
  int cnt = 0;
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      if (d(i, j, p) == (int)d(i, j, p)) cnt++;
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'long double d(int, int, std::vector<std::vector<int> >)':
a.cc:6:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |   for (int k = 0; i < d; i++)
      |                   ~~^~~
a.cc: In function 'int main()':
a.cc:20:12: error: 'd' cannot be used as a function
   20 |       if (d(i, j, p) == (int)d(i, j, p)) cnt++;
      |           ~^~~~~~~~~
a.cc:20:31: error: 'd' cannot be used as a function
   20 |       if (d(i, j, p) == (int)d(i, j, p)) cnt++;
      |                              ~^~~~~~~~~
Language: C++

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

int main() {
    int D,N;
    cin >> D >> N;
    vector<vector<int>> V (N,vector<int>(D));
    for (int i=0 ; i<N ; i++){
        for (int j=0 ; j<D ; j++){
            cin >> V.at(i).at(j);
        }
    }
    int ans=0;   
    for (int i=0 ; i<N ; i++){
        for (int j=i+1 ; j<N ; j++){
            int nijo=0;
            for (int k=0 ; k<D ; k++){
                int dif=abs(V.at(i).at(j)-V.at(k).at(j);
                nijo+=dif*dif;
            }
            bool A=false;
            for (int l=0 ; l<=nijo ; l++){
                if (nijo==l*l)
                    A=true;
                if (A)
                    ans++;
            }
        }
    }
    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:56: error: expected ')' before ';' token
   18 |                 int dif=abs(V.at(i).at(j)-V.at(k).at(j);
      |                            ~                           ^
      |                                                        )
Language: C++

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

int main() {
    int D,N;
    cim >> D >> N;
    vector<vector<int>> V (N,vector<int>(D))
    for (int i=0 ; i<N ; i++){
        for (int j=0 ; j<D ; j++){
            cin >> V.at(i).at(j);
        }
    }
    int ans=0;   
    for (int i=0 ; i<N ; i++){
        for (int j=i+1 ; j<N ; j++){
            int nijo=0;
            for (int k=0 ; k<D ; k++){
                int dif=abs(V.at(i).at(j)-V.at(k).at(j);
                nijo+=dif*dif;
            }
            bool A=false
            for (int l=0 ; l<=nijo ; l++){
                if (nijo==l*l)
                    A=true;
                if (A)
                    ans++;
            }
        }
    }
    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cim' was not declared in this scope
    6 |     cim >> D >> N;
      |     ^~~
a.cc:8:5: error: expected ',' or ';' before 'for'
    8 |     for (int i=0 ; i<N ; i++){
      |     ^~~
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for (int i=0 ; i<N ; i++){
      |                    ^
a.cc:18:56: error: expected ')' before ';' token
   18 |                 int dif=abs(V.at(i).at(j)-V.at(k).at(j);
      |                            ~                           ^
      |                                                        )
a.cc:22:13: error: expected ',' or ';' before 'for'
   22 |             for (int l=0 ; l<=nijo ; l++){
      |             ^~~
a.cc:22:28: error: 'l' was not declared in this scope
   22 |             for (int l=0 ; l<=nijo ; l++){
      |                            ^
Language: C++

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

int main(void){
    int n, d;
    cin >> n >> d;
    vector<vector<int>> num(n,vector<int>(d,0));
    int ans = 0;

    for (int i = 0; i < n;i++){
        for (int j = 0; j < d;j++){
            cin >> num.at(i).at(j);
        }
    }
    int ans = 0;
    for (int i = 0; i < n-1; i++){
        for (int j = i+1; j < n; j++){
            int norm = 0;
            for (int k = 0; k < d;k++){
                int diff = abs(num.at(i).at(k) - num.at(j).at(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;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: redeclaration of 'int ans'
   15 |     int ans = 0;
      |         ^~~
a.cc:8:9: note: 'int ans' previously declared here
    8 |     int ans = 0;
      |         ^~~
Language: C++

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

int main(){
  int n, d;
  cin >> n >> d;
  double x[n][d];
  rep(i, n){
    rep(j, d){
      cin >> x[i][j];
    }
  }
  
  int count = 0;
  rep(i, n-1){
    for(int j=i+1; j<n; ++j){
      double insideRoot = 0;
      rep(k, d){
        insideRoot += pow(x[i][k]-x[j][k], 2);
      }
      double distance = sqrt(insideRoot);
      if(distance % 1.0 == 0.0) ++ count;
    }
  }
  
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   23 |       if(distance % 1.0 == 0.0) ++ count;
      |          ~~~~~~~~ ^ ~~~
      |          |          |
      |          double     double
Language: C++

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

int main() {
  int N, D;
  cin >> N >> D;
  vector<vector<int>> ND(N, vector<int>(D));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < D; j++) cin >> ND.at(i).at(j);
    }
  }

  int ans = 0;

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i <= j) continue;
      int dis = 0;
      for (int k = 0; k < D; k++) {
        int X = ND.at(i).at(k) - ND.at(j).at(k);
        dis += X * X;
      }
      if (sqrt(dis) == (int)sqrt(dis)) ans++;
    }
  }

  cout << ans << "\n";
}

Compiler output:
a.cc:15:3: error: expected unqualified-id before 'for'
   15 |   for (int i = 0; i < N; i++) {
      |   ^~~
a.cc:15:19: error: 'i' does not name a type
   15 |   for (int i = 0; i < N; i++) {
      |                   ^
a.cc:15:26: error: 'i' does not name a type
   15 |   for (int i = 0; i < N; i++) {
      |                          ^
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << ans << "\n";
      |   ^~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int D = Integer.parseInt(sc.next());
        int[][] point = new int[N][D];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < D; j++) {
                point[i][j] = Integer.parseInt(sc.next());
            }
        }

        int counter = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                int tmpSum = 0;
                for (int k = 0; k < D; k++) {
                    tmpSum += Math.pow(point[i][k] - point[j][k], 2);
                }

                if (isPerfectSquare(tmpSum)) {
                    counter++;
                }
            }
        }

        System.out.println(counter);
    }

    private static boolean isPerfectSquare(int n) {
        if (n < 0)
            return false;

        int tst = Math.round((Math.sqrt(n) + 0.5);
        return tst * tst == n;
    }
}

Compiler output:
Main.java:36: error: ')' or ',' expected
        int tst = Math.round((Math.sqrt(n) + 0.5);
                                                 ^
1 error
Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <random>
#include <chrono>
#include <iomanip>
#define lint long long int
#define FOR(x, to) for(int x=0; x<(int)(to); x++) // for簡略表記
#define DUMP(ar) for(int loop=0; loop<(int)ar.size(); loop++) cout << "[" << loop << "]:" << ar[loop] << endl // 配列一覧表示
#define DUMPL(ar) for(int loop=0; loop<(int)ar.size(); loop++) { cout << ar[loop]; if(loop<(int)ar.size()-1) cout << ' '; } cout << endl; // 配列一行一覧表示
#define COUT(x) cout << x << endl // 単要素出力
#define ALL(ar) ar.begin(), ar.end() // コンテナの全要素
#define LOOPD(i) cout << "ループ[" << i << "]回目---------------" << endl // ループ回数デバグ
using namespace std;
// cout << fixed << setprecision(4) で小数点以下4桁の桁そろえ
// cout << setw(5) << ... で表示形式を5桁に設定 5桁未満なら頭に空白がつく 5桁越なら先頭から5桁まで
// cout << setw(5) << setfill('0') << ... で空白部分の埋め文字に5を使う
// getline(cin, [変数]); で空白などを含む入力の受け取り(行ごとの受け取り)
// cin >> ws; でそこまでにストリームに残されたホワイトスペースを取り除く(=以降のgetlineの有効化)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,d,sum=0;
  cin >> n >>d;
  vector<vector<int>>A(n,vector<int>(d,0));
  FOR(i,n){
    FOR(j,d){
    cin>>A[i][j];
    }
     
  }
  double s;
  FOR(i,n-1){
  for(int j=i+1; j<n; j++){
    s=0;
    FOR(k,d){
       s+=pow(abs(A[i][k]-A[j][k]),2)
         
    
    }
    if(abs(sqrt(s)-(int)(sqrt(s)))<0.0001){
    sum++;
    }
    
    
  
  }
     
    
  }
cout<<sum<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:38: error: expected ';' before '}' token
   42 |        s+=pow(abs(A[i][k]-A[j][k]),2)
      |                                      ^
      |                                      ;
......
   45 |     }
      |     ~
Language: C++

#include<stdio.h>
int main(void){
  int point[10][10]={0};
  int N,D;
  int i,j;
  int distance=0;
  scanf("%d %d",&N,%D);
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
      scanf("%d",point[i][j]);
    }
  }
  
  for(i=0;i<N;i++){
    for(j=0;j<D;j++){
      distance=point[i][j]-point[i+1][j]
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected primary-expression before '%' token
    7 |   scanf("%d %d",&N,%D);
      |                    ^
a.cc:16:41: error: expected ';' before '}' token
   16 |       distance=point[i][j]-point[i+1][j]
      |                                         ^
      |                                         ;
   17 |     }
      |     ~
Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <random>
#include <chrono>
#include <iomanip>
#define lint long long int
#define FOR(x, to) for(int x=0; x<(int)(to); x++) // for簡略表記
#define DUMP(ar) for(int loop=0; loop<(int)ar.size(); loop++) cout << "[" << loop << "]:" << ar[loop] << endl // 配列一覧表示
#define DUMPL(ar) for(int loop=0; loop<(int)ar.size(); loop++) { cout << ar[loop]; if(loop<(int)ar.size()-1) cout << ' '; } cout << endl; // 配列一行一覧表示
#define COUT(x) cout << x << endl // 単要素出力
#define ALL(ar) ar.begin(), ar.end() // コンテナの全要素
#define LOOPD(i) cout << "ループ[" << i << "]回目---------------" << endl // ループ回数デバグ
using namespace std;
// cout << fixed << setprecision(4) で小数点以下4桁の桁そろえ
// cout << setw(5) << ... で表示形式を5桁に設定 5桁未満なら頭に空白がつく 5桁越なら先頭から5桁まで
// cout << setw(5) << setfill('0') << ... で空白部分の埋め文字に5を使う
// getline(cin, [変数]); で空白などを含む入力の受け取り(行ごとの受け取り)
// cin >> ws; でそこまでにストリームに残されたホワイトスペースを取り除く(=以降のgetlineの有効化)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,d,sum=0;
  cin >> n >>d;
  vector<vector<int>>A(n,vector<int>(d,0));
  FOR(i,n){
    FOR(j,d){
    cin>>A[i][j];
    }
     
  }
  double s;
  FOR(i,n-1){
  for(int j=i+1; j<n; j++){
    s=0;
    FOR(k,d){
       s+=pow(abs(A[i][k]-A[j][k]),2)
         
    
    }
    if(abs(sqrt(s)-(int)(sprt(s)))<0.0001){
    sum++;
    }
    
    
  
  }
     
    
  }
cout<<sum<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:38: error: expected ';' before '}' token
   42 |        s+=pow(abs(A[i][k]-A[j][k]),2)
      |                                      ^
      |                                      ;
......
   45 |     }
      |     ~                                 
a.cc:46:26: error: 'sprt' was not declared in this scope; did you mean 'sqrt'?
   46 |     if(abs(sqrt(s)-(int)(sprt(s)))<0.0001){
      |                          ^~~~
      |                          sqrt
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  int D;
  
  cin >> N >> D;
  
  vector<vector<double>> X(N,vector<double>(D));
  
  for(int i = 0;i < N;++i){
    for(int j = 0;j < D;++j){
      cin >> X[i][j];
    }
  }
  
  double num;
  double num2;
  
  double num3 = 0.0;
  
  double num4;
  
  int num5 = 0;
  
  for(int i = 0;i < N - 1;++i){
    for(int k = i + 1;k < N;++k){
      for(int j = 0;j < N;++j){
        num = abs(X[i][j] - X[k][j]);
        num2 = num * num;
        num3 = num3 + num2;
      }
      num4 = sqrt(num3);
      if(eil(num4) == floor(num4)){
        num5++;
      }
    }
  }
  
  cout << num5 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:10: error: 'eil' was not declared in this scope; did you mean 'ceil'?
   35 |       if(eil(num4) == floor(num4)){
      |          ^~~
      |          ceil
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  int D;
  
  cin >> N >> D;
  
  vector<vector<double>> X(N,vector<double>(D));
  
  for(int i = 0;i < N;++i){
    for(int j = 0;j < D;++j){
      cin >> X[i][j];
    }
  }
  
  double num;
  double num2;
  
  double num3 = 0.0;
  
  double num4;
  
  int num5 = 0;
  
  for(int i = 0;i < N - 1;++i){
    for(int k = i + 1;k < N;++k){
      for(int j = 0;j < N;++j){
        num = abs(X[i][j] - X[k][j]);
        num2 = num * num;
        num3 = num3 + num2;
      }
      num4 = sqrt(num3);
      if(num4 % 1 == 0){
        num5++;
      }
    }
  }
  
  cout << num5 << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  int D;
  
  cin >> N >> D;
  
  vector<vector<double>> X(N,vector<double>(D));
  
  for(int i = 0;i < N;++i){
    for(int j = 0;j < D;++j){
      cin >> X[i][j];
    }
  }
  
  double num;
  double num2;
  
  double num3 = 0.0;
  
  double num4;
  
  int num5 = 0;
  
  for(int i = 0;i < N - 1;++i){
    for(int k = i + 1;k < N;++k){
      for(int j = 0;j < N;++j){
        num = abs(X[i][j] - X[k][j]);
        num2 = num * num;
        num3 = num3 + num2;
      }
      num4 = sqrt(num3);
      if(num4 % 1.0 == 0){
        num5++;
      }
    }
  }
  
  cout << num5 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   35 |       if(num4 % 1.0 == 0){
      |          ~~~~ ^ ~~~
      |          |      |
      |          double double
Language: C

#include <iostream>
#include <vector>
#include <cmath>
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];
        }
        }
        vector<double> l;
        int temp;
        for (int a = 0; a < n - 1; ++a) {
                for (int b = a + 1; b < n; ++b){
                        double r = 0;
                        for (int c = 0; c < d; ++c) {
                                temp = x[a][c] - x[b][c];
                                r += temp * temp;
                        }
                        l.push_back(sqrt(r));
                }
        }
        int ans;
        for (int i = 0; i < l.size(); ++i) {
                if (l[i] == floor(l[i])) {
                        ++ans;
                }
        }
        cout << ans << endl;
        return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int n, d;
  cin >> n >> d;
  double x[n][d];
  for(int i=0; i<n; ++i){
    for(int j=0; j<d; ++j){
      cin >> x[i][j];
    }
  }
  
  int result = 0;
  for(int i=0; i<(n-1); ++i){
    for(int j=(i+1); j<n; ++j){
      double distance = 0;
      for(int k=0; k<d; ++k){
        distance += pow(x[i][k]-x[j][k], 2.0);
        distance = sqrt(distance);
      }
      
      int intdistance = distance
      if((distance - intdistance) == 0){
        ++ result;
      }
    }
  }
  
  cout << result << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: expected ',' or ';' before 'if'
   24 |       if((distance - intdistance) == 0){
      |       ^~
Language: C++

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

int main(){
  int n, d;
  cin >> n >> d;
  double x[n][d];
  for(int i=0; i<n; ++i){
    for(int j=0; j<d; ++j){
      cin >> x[i][j];
    }
  }
  
  int result = 0;
  for(int i=0; i<(n-1); ++i){
    for(int j=(i+1); j<n; ++j){
      double distance = 0;
      for(int k=0; k<d; ++k){
        distance += pow(x[i][k]-x[j][k], 2.0);
        distance = sqrt(distance);
      }
      if(distance % 1 == 0.0){
        ++ result;
      }
    }
  }
  
  cout << result << endl;
  return 0;
}

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

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

int isSqr(int x){
  int i=0;
  while(i*i<=x){
    if(i*i==x)return 1;
    i++;
  }
  return 0;
}

int dim2(int* x,int* y,d){
  int sum=0;
  for(int i=0;i<sizeof(x)/sizeof(int);i++){
    sum+=(x[i]-y[i])*(x[i]-y[i]);
  }
  return sum;
}

int main(){
  int n,d,i,j,cnt=0;
  cin>>n>>d;
  int x[n][d];
  for(i=0;i<n;i++){
    for(j=0;j<d;j++){
      cin>>x[i][j];
    }
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(isSqr(dim2(x[i],x[j],d)))cnt++;
    }
  }
  cout<<cnt;
}

Compiler output:
a.cc:13:24: error: 'd' has not been declared
   13 | int dim2(int* x,int* y,d){
      |                        ^
Language: C++

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

int isSqr(int x){
  int i=0;
  while(i*i<=x){
    if(i*i==x)return 1;
    i++;
  }
  return 0;
}

int dim2(int* x,int* y,d){
  int sum=0;
  for(int i=0;i<sizeof(x)/sizeof(int);i++){
    sum+=(x[i]-y[i])*(x[i]-y[i]);
  }
  return sum;
}

int main(){
  int n,d,i,j,cnt=0;
  cin>>n>>d;
  int x[n][d];
  for(i=0;i<n;i++){
    for(j=0;j<d;j++){
      cin>>x[i][j];
    }
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(isSqr(dim2(x[i],x[j])))cnt++;
    }
  }
  cout<<cnt;
}

Compiler output:
a.cc:13:24: error: 'd' has not been declared
   13 | int dim2(int* x,int* y,d){
      |                        ^
a.cc: In function 'int main()':
a.cc:32:20: error: too few arguments to function 'int dim2(int*, int*, int)'
   32 |       if(isSqr(dim2(x[i],x[j])))cnt++;
      |                ~~~~^~~~~~~~~~~
a.cc:13:5: note: declared here
   13 | int dim2(int* x,int* y,d){
      |     ^~~~