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

#include<stdio.h>
#include<math.h>
int main()
{
	int n,d,i,j,s,c=0;

	scanf("%d%d",&n,&d);

	int x[n][d];

	for(i=0;i<n;i++)
		for(j=0;j<d;j++)
			scanf("%d",&x[i][j]);
	for(i=0;i<n;i++)
		for(j=0;j<d;j++){
			s=sqrt(pow((double)x[i+1]-x[i]),2)
			if((s==ceil(s))&&(s==foor(s)))
				c++;
		}
	printf("%d",c);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:25: error: pointer value used where a floating-point was expected
   16 |                         s=sqrt(pow((double)x[i+1]-x[i]),2)
      |                         ^
main.c:16:32: error: too few arguments to function 'pow'
   16 |                         s=sqrt(pow((double)x[i+1]-x[i]),2)
      |                                ^~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: declared here
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
main.c:16:27: error: too many arguments to function 'sqrt'
   16 |                         s=sqrt(pow((double)x[i+1]-x[i]),2)
      |                           ^~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: declared here
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
main.c:16:59: error: expected ';' before 'if'
   16 |                         s=sqrt(pow((double)x[i+1]-x[i]),2)
      |                                                           ^
      |                                                           ;
   17 |                         if((s==ceil(s))&&(s==foor(s)))
      |                         ~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,D;
  cin>>N>>D;
  veector<vector<int>> A(N,vector<int>(D));
  for(int i=0;i<N;i++){
  for(int j=0;j<D;j++){
  cin>>A[i][j];
  }
  }
  int a =0;
  for(int i=0;i<N;i++){
  for(int j=i+1;j<N;j++){
  int count=0;
    for(int k=0;k<D;k++){
    int d=abs(A[i][k]-A[j][k]);
      count+=d*d;
    }
    bool f=false;
    for(int k=0;k<=count;k++){
    if(k*k==count){
    f=true;
    }
    }
  if(f){
  a++;
  }
  }
  }
cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'veector' was not declared in this scope
    6 |   veector<vector<int>> A(N,vector<int>(D));
      |   ^~~~~~~
a.cc:6:21: error: expected primary-expression before '>' token
    6 |   veector<vector<int>> A(N,vector<int>(D));
      |                     ^~
a.cc:6:24: error: 'A' was not declared in this scope
    6 |   veector<vector<int>> A(N,vector<int>(D));
      |                        ^
Language: C

#include<stdio.h>
#include<math.h>
int main(void){
  int n,d,i,j,k,sqi,cnt=0;
  scanf("%d %d",&n,&d);
  int  num[n][d];
  double sum=0,sqd;
  for(i=0;i<n;i++){
    for(j=0;j<d;j++){
      scanf("%d",&num[n][d]);
    }
  }
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      sum=0:
      for(k=0;k<d;k++){
        sum+=pow(num[i][k]-num[j][k],2);
      }
    }
    sqi=(int)sqrt(sum);
    sqd=(double)sqrt(sum);
    if(sqd-sqi==0){
      cnt++;
    }
  }
  printf("%d",cnt);
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:15:12: error: expected ';' before ':' token
   15 |       sum=0:
      |            ^
      |            ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
double distance(vector<double>A,vector<double>B){
  if(A.size()==B.size){
    double sum=0;
    for(int i=0;i<A.size();i++){
      sum=sum+(A.at(i)-B.at(i))*(A.at(i)-B.at(i));
    }
    return sqrt(sum);
  }
  else{
    return 0;
  }
}

bool is_integer_modf( double x ){
  double r;
  return 0==std::modf(x, &r);
}
      
int main(){
  int 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.at(i).at(j);
    }
  }
  int count=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      if(is_integer_modf(distance(X.at(i),X.at(j)))){
        count=count+1;
      }
    }
  }
  cout<<count<<endl;
}
  
  


Compiler output:
a.cc: In function 'double distance(std::vector<double>, std::vector<double>)':
a.cc:4:18: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = double; _Alloc = std::allocator<double>; size_type = long unsigned int]' (did you forget the '()' ?)
    4 |   if(A.size()==B.size){
      |                ~~^~~~
      |                      ()
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
double distance(vector<double>A,vector<double>B){
  if(A.size()==B.size){
    double sum=0;
    for(int i=0;i<A.size();i++){
      sum=sum+(A.at(i)-B.at(i))*(A.at(i)-B.at(i));
    }
    return sqrt(sum);
  }
  else{
    return 0;
  }
}

bool is_integer_modf( double x ){
  double r;
  return 0==std::modf(x, &r);
}
      
int main(){
  int N,D;
  vector<vector<double>>X(N,vactor<double>(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++){
      if(is_integer_modf(distance(X.at(i),X.at(j)))){
        count=count+1;
      }
    }
  }
  cout<<count<<endl;
}
  
  

Compiler output:
a.cc: In function 'double distance(std::vector<double>, std::vector<double>)':
a.cc:4:18: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = double; _Alloc = std::allocator<double>; size_type = long unsigned int]' (did you forget the '()' ?)
    4 |   if(A.size()==B.size){
      |                ~~^~~~
      |                      ()
a.cc: In function 'int main()':
a.cc:23:29: error: 'vactor' was not declared in this scope
   23 |   vector<vector<double>>X(N,vactor<double>(D));
      |                             ^~~~~~
a.cc:23:36: error: expected primary-expression before 'double'
   23 |   vector<vector<double>>X(N,vactor<double>(D));
      |                                    ^~~~~~
a.cc: In function 'double distance(std::vector<double>, std::vector<double>)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
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 >> x[i][j];
  }
  int ans = 0;
  rep(i,n) rep(j,i){
      int sq=0;
      rep(k,d){
        int s = x[i][k]-x[j][k];//差
        sq+=s*s;
      }
      int s=sqrt(sq)+0.5;//intのcast(型変換)は切り捨てなので、四捨五入のための+0.5。ex)1.9999は切り捨てされると1になる
      if (s*s==sq) ans++;
  }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: template argument 1 is invalid
    8 |   vector<vector<int> x(n, vector<int>(d));
      |                                         ^
a.cc:8:41: error: template argument 2 is invalid
a.cc:10:21: error: 'x' was not declared in this scope
   10 |     rep(j,d) cin >> x[i][j];
      |                     ^
a.cc:16:17: error: 'x' was not declared in this scope
   16 |         int s = x[i][k]-x[j][k];//差
      |                 ^
Language: C++

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

double dist(vector<int> x,vector<int> y){
  double res;
  for(int i=0;i<x.size();i++){
    res += (x[i]-y[i])*(x[i]-y[i]);
  }
  return sqrt(res)
}

bool isD(double x){
  return abs(x-int(x))<1e-9;
}

int main(){
  int n,d; cin >> n >> d;
  vector<vector<int>> X(n,vector<int>(d,0));
  int ans=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++) if(isD(dist(X[i],X[j]))) ans++;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'double dist(std::vector<int>, std::vector<int>)':
a.cc:11:19: error: expected ';' before '}' token
   11 |   return sqrt(res)
      |                   ^
      |                   ;
   12 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

ind dist(int x, const vector<int>& data1(x), const vector<int>& data2(x)) {
  dset(10);
  ind ret = 0;
  rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
  ret = sqrt(ret);
  return ret;
}

int main() {
  kyun;
  int n,d;
  cin >> n >> d;
  vii data(n,vi(d));
  rep(i,n) rep(j,d) cin >> data[i][j];
  int ans = 0;
  rep(i,n) {
    rep(j,n) {
      if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
    }
  }
  cout << ans;
  hinata;
}


Compiler output:
a.cc:22:41: error: expected ',' or '...' before '(' token
   22 | ind dist(int x, const vector<int>& data1(x), const vector<int>& data2(x)) {
      |                                         ^
a.cc: In function 'ind dist(int, const std::vector<int>&)':
a.cc:25:29: error: 'data2' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
      |                             ^~~~~
      |                             data1
a.cc: In function 'int main()':
a.cc:39:24: error: too many arguments to function 'ind dist(int, const std::vector<int>&)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, const vector<int>& data1(x), const vector<int>& data2(x)) {
      |     ^~~~
a.cc:39:56: error: too many arguments to function 'ind dist(int, const std::vector<int>&)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                                                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, const vector<int>& data1(x), const vector<int>& data2(x)) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

ind dist(int x, vector<int>& data1(x), vector<int>& data2(x)) {
  dset(10);
  ind ret = 0;
  rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
  ret = sqrt(ret);
  return ret;
}

int main() {
  kyun;
  int n,d;
  cin >> n >> d;
  vii data(n,vi(d));
  rep(i,n) rep(j,d) cin >> data[i][j];
  int ans = 0;
  rep(i,n) {
    rep(j,n) {
      if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
    }
  }
  cout << ans;
  hinata;
}


Compiler output:
a.cc:22:35: error: expected ',' or '...' before '(' token
   22 | ind dist(int x, vector<int>& data1(x), vector<int>& data2(x)) {
      |                                   ^
a.cc: In function 'ind dist(int, std::vector<int>&)':
a.cc:25:29: error: 'data2' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
      |                             ^~~~~
      |                             data1
a.cc: In function 'int main()':
a.cc:39:24: error: too many arguments to function 'ind dist(int, std::vector<int>&)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vector<int>& data1(x), vector<int>& data2(x)) {
      |     ^~~~
a.cc:39:56: error: too many arguments to function 'ind dist(int, std::vector<int>&)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                                                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vector<int>& data1(x), vector<int>& data2(x)) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

ind dist(int x, vector<int> data1(x), vector<int> data2(x)) {
  dset(10);
  ind ret = 0;
  rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
  ret = sqrt(ret);
  return ret;
}

int main() {
  kyun;
  int n,d;
  cin >> n >> d;
  vii data(n,vi(d));
  rep(i,n) rep(j,d) cin >> data[i][j];
  int ans = 0;
  rep(i,n) {
    rep(j,n) {
      if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
    }
  }
  cout << ans;
  hinata;
}


Compiler output:
a.cc:22:34: error: expected ',' or '...' before '(' token
   22 | ind dist(int x, vector<int> data1(x), vector<int> data2(x)) {
      |                                  ^
a.cc: In function 'ind dist(int, std::vector<int>)':
a.cc:25:29: error: 'data2' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(data1[i]-data2[i]);
      |                             ^~~~~
      |                             data1
a.cc: In function 'int main()':
a.cc:39:24: error: too many arguments to function 'ind dist(int, std::vector<int>)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vector<int> data1(x), vector<int> data2(x)) {
      |     ^~~~
a.cc:39:56: error: too many arguments to function 'ind dist(int, std::vector<int>)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                                                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vector<int> data1(x), vector<int> data2(x)) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

ind dist(int x, vi data1(x), vi data2(x)) {
  dset(10);
  ind ret = 0;
  rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
  ret = sqrt(ret);
  return ret;
}

int main() {
  kyun;
  int n,d;
  cin >> n >> d;
  vii data(n,vi(d));
  rep(i,n) rep(j,d) cin >> data[i][j];
  int ans = 0;
  rep(i,n) {
    rep(j,n) {
      if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
    }
  }
  cout << ans;
  hinata;
}


Compiler output:
a.cc:22:25: error: expected ',' or '...' before '(' token
   22 | ind dist(int x, vi data1(x), vi data2(x)) {
      |                         ^
a.cc: In function 'ind dist(int, vi)':
a.cc:25:29: error: 'data2' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
      |                             ^~~~~
      |                             data1
a.cc:25:40: error: 'dsta1' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
      |                                        ^~~~~
      |                                        data1
a.cc: In function 'int main()':
a.cc:39:24: error: too many arguments to function 'ind dist(int, vi)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vi data1(x), vi data2(x)) {
      |     ^~~~
a.cc:39:56: error: too many arguments to function 'ind dist(int, vi)'
   39 |       if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
      |                                                    ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:5: note: declared here
   22 | ind dist(int x, vi data1(x), vi data2(x)) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

ind dist(int x, vi data1(x), vi data2(x)) {
  dset(10);
  ind ret = 0;
  rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
  ret = sqrt(ret);
  return ret;
}

int main() {
  kyun;
  itn n,d;
  cin >> n >> d;
  vii data(n,vi(d));
  rep(i,n) rep(j,d) cin >> data[i][j];
  int ans = 0;
  rep(i,n) {
    rep(j,n) {
      if(i < j) if(dist(d,data[i],data[j]) == (int)dist(d,data[i],data[j])) ans++;
    }
  }
  cout << ans;
  hinata;
}

Compiler output:
a.cc:22:25: error: expected ',' or '...' before '(' token
   22 | ind dist(int x, vi data1(x), vi data2(x)) {
      |                         ^
a.cc: In function 'ind dist(int, vi)':
a.cc:25:29: error: 'data2' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
      |                             ^~~~~
      |                             data1
a.cc:25:40: error: 'dsta1' was not declared in this scope; did you mean 'data1'?
   25 |   rep(i,x) ret += (data1[i]-data2[i])*(dsta1[i]-data2[i]);
      |                                        ^~~~~
      |                                        data1
a.cc: In function 'int main()':
a.cc:32:3: error: 'itn' was not declared in this scope; did you mean 'int'?
   32 |   itn n,d;
      |   ^~~
      |   int
a.cc:33:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   33 |   cin >> n >> d;
      |          ^
      |          yn
a.cc:33:15: error: 'd' was not declared in this scope
   33 |   cin >> n >> d;
      |               ^
Language: C++

import math
N,D = map(int,input().split())
X = [0]*N
total = 0
cnt = 0
for i in range(N):
  X[i] = list(map(int,input().split()))
for i in range(N-1):
  for j in range(i+1,N):
    for k in range(D):
      total += abs(X[j][k]-X[i][k])**2
    if math.sqrt(total)%1==0:
      cnt += 1
    total=0
print(cnt)

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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    // Your code here!
    ll n,d;
    cin>>n>>d;
    ll x[n][d];
    rep(0,i,n)rep(0,j,d)cin>>x[i][j];
    ll ans=0;
    rep(0,i,n){
        ll sum=0;
        rep(i+1,j,n){
            sum=0;
            rep(0,k,d)sum+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
                if((ll)sqrt(sum)==sqrt(sum)){
                    ++ans;
                }
        }
    }
    cout<<ans;

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

#include <bits/stdc++.h>
#include <math.h>
#include <regex>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;
ld n , d;
vector<vector<ld>> x;

ld dis(int a, int b){
    ld ret = 0.0;
    for(int i=0;i<d;i++){
        ret += (x.at(a).at(i) - x.at(b).at(i)) *  (x.at(a).at(i) - x.at(b).at(i));
    }
    return ret;
}

int main(){
    cin >> n >> d;
    x.resize(n,vector<ld>(d));
    rep(i,n) rep(j,d) cin >> x.at(i).at(j);

    ll ans = 0;

    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            if(sqrt(dis(i,j)) * sqrt(dis(i,j)) == dis(i,j)) ans++;
        }
    }
    cout << ans << endl;
}

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

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

    int N, D; cin >> N >> D;
    vector<vector<int>> X(N);

    int tmp;
    rep(i,N) rep(j,D) {
        cin >> tmp;
        X[i].push_back(tmp);
    }

    int sum = 0;
    int ans = 0;
    for (int i = 0; i < N - 1; i++) {
        for (int j = i + 1; j < N; j++) {
            for (int k = 0; k < D; k++) {
                sum += (X[j][k] - X[i][k]) * (X[j][k] - X[i][k]);
            }
            for (int l = 0; l <= sum; l++) {
                if (l * l == sum) ans++;
            }
            sum = 0;
        }
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'ios' has not been declared
    3 |     ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |     ^~~
a.cc:3:34: error: 'cin' was not declared in this scope
    3 |     ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                  ^~~
a.cc:3:42: error: 'NULL' was not declared in this scope
    3 |     ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                          ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | int main()
a.cc:3:49: error: 'cout' was not declared in this scope
    3 |     ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                                 ^~~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<vector<int>> X(N);
      |     ^~~~~~
a.cc:6:19: error: expected primary-expression before 'int'
    6 |     vector<vector<int>> X(N);
      |                   ^~~
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     rep(i,N) rep(j,D) {
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope
    9 |     rep(i,N) rep(j,D) {
      |     ^~~
a.cc:19:25: error: 'X' was not declared in this scope
   19 |                 sum += (X[j][k] - X[i][k]) * (X[j][k] - X[i][k]);
      |                         ^
a.cc:28:20: error: 'endl' was not declared in this scope
   28 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int N,D;
  int X[N][D];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=D; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
     
      for(int k=1; k<=D; k++){
        bool t=false;
      distance+=pow((X[i][k]-X[j][k]),2);
       
        for (int l=1; l<=1000; l++){
          if (distance==pow(l,2)) t=true;
        }}
      if (t) counter++;}}
  cout<<counter<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 't' was not declared in this scope
   23 |       if (t) counter++;}}
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int N,D;
  int X[N][N];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=N; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
      for(int k=1; k<=N; k++){
      distance+=pow((X[i][k]-X[j][k]),2);
        bool t=false;
        for (int l=1; l<=300; l++){
          if (distance==pow(l,2)) t=true;
        }}
      if (t) counter++;}}
  cout<<counter<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 't' was not declared in this scope
   21 |       if (t) counter++;}}
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N,D;
  int X[N][N];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=N; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
      for(int k=1; k<=N; k++){
      distance+=pow((X[i][k]-X[j][k]),2);
        bool t=false;
        for (int i=1; i<=300; i++){
          if (distance==i**) t=true;
        }
      if (t) counter++;}}}
  cout<<counter<<endl;}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'pow' was not declared in this scope
   15 |       distance+=pow((X[i][k]-X[j][k]),2);
      |                 ^~~
a.cc:18:28: error: expected primary-expression before ')' token
   18 |           if (distance==i**) t=true;
      |                            ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N,D;
  int X[N][N];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=N; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
      for(int k=1; k<=N; k++){
      distance+=(X[i][k]-X[j][k])**;
        bool t=false;
        for (int i=1; i<=300; i++){
          if (distance==i**) t=true;
        }
      if (t) counter++;}}}
  cout<<counter<<endl;}
  
  
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: expected primary-expression before ';' token
   15 |       distance+=(X[i][k]-X[j][k])**;
      |                                    ^
a.cc:18:28: error: expected primary-expression before ')' token
   18 |           if (distance==i**) t=true;
      |                            ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N,D;
  int X[N][N];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=N; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
      for(int k=1; k<=N; k++){
      distance+=(X[i][k]-X[j][k])**;
        bool t=false;
        for (int i=1; i<=300; i++){
          if (distance==i**) t=true;
        }
      if (t) counter++;}}}
  cout<<counter<<endl;}
  
  
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: expected primary-expression before ';' token
   14 |       distance+=(X[i][k]-X[j][k])**;
      |                                    ^
a.cc:17:28: error: expected primary-expression before ')' token
   17 |           if (distance==i**) t=true;
      |                            ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N,D;
  int X[N][N];
  for (int i=1; i<=N; i++){
    for (int j=1; j<=N; j++){
      cin>>X[i][j];}}
  int counter=0;
  for (int i=1; i<=N; i++){
    for (int j=i+1; j<=N; j++){
      int distance=0;
      for(int k=1; k<=N; k++){
      distance+=(X[i][k]-X[j][k])**;
        bool t=false;
        for (int i=1; i<=300; i++){
          if (distance==i**) t=true;
        }}
      if (t) counter++;}}
  
  
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: expected primary-expression before ';' token
   14 |       distance+=(X[i][k]-X[j][k])**;
      |                                    ^
a.cc:17:28: error: expected primary-expression before ')' token
   17 |           if (distance==i**) t=true;
      |                            ^
a.cc:19:11: error: 't' was not declared in this scope
   19 |       if (t) counter++;}}
      |           ^
a.cc:19:26: error: expected '}' at end of input
   19 |       if (t) counter++;}}
      |                          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int N,D;
  cin >> N >> D;
  vector<vector<int>> ve(N,vector<int> vec(D,0));
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> ve[i][j];
    }
  }
  int cnt=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      ll a=0;
      for(int k=0;k<D;i++){
        a +=(ve[i][k]-ve[j][k])*(ve[i][k]-ve[j][k]);
      }
      for(int b=0;b<200;b++){
        if(a==b*b){
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: expected primary-expression before 'vec'
   10 |   vector<vector<int>> ve(N,vector<int> vec(D,0));
      |                                        ^~~
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int N,D;
  cin >> N >> D;
  vector<vector<int>> vec(N,vector<int> vec(D,0));
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> vec[i][j];
    }
  }
  int cnt=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      ll a=0;
      for(int k=0;k<D;i++){
        a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      }
      for(int b=0;b<200;b++){
        if(a==b*b){
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: expected primary-expression before 'vec'
   10 |   vector<vector<int>> vec(N,vector<int> vec(D,0));
      |                                         ^~~
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int N,D;
  cin >> N >> D;
  vector<vector<int>> vec(N,vector<int> v(D,0));
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> vec[i][j];
    }
  }
  int cnt=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      ll a=0;
      for(int k=0;k<D;i++){
        a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      }
      for(int b=0;b<200;b++){
        if(a==b*b){
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: expected primary-expression before 'v'
   10 |   vector<vector<int>> vec(N,vector<int> v(D,0));
      |                                         ^
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int N,D;
  cin >> N >> D;
  vector<int> vec(N,vector<int> v(D,0));
  for(int i=0;i<N;i++){
    for(int j=0;j<D;j++){
      cin >> vec[i][j];
    }
  }
  int cnt=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      ll a=0;
      for(int k=0;k<D;i++){
        a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      }
      for(int b=0;b<200;b++){
        if(a==b*b){
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: expected primary-expression before 'v'
   10 |   vector<int> vec(N,vector<int> v(D,0));
      |                                 ^
a.cc:13:20: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   13 |       cin >> vec[i][j];
      |                    ^
a.cc:21:20: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   21 |         a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      |                    ^
a.cc:21:30: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   21 |         a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      |                              ^
a.cc:21:42: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   21 |         a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      |                                          ^
a.cc:21:52: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   21 |         a +=(vec[i][k]-vec[j][k])*(vec[i][k]-vec[j][k]);
      |                                                    ^
Language: C++

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

using namespace std;

const long long INF = 1LL << 60;
const long long P = 1000000007;

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 < 45; i++) {
    for(int j = 0; j < n; j++) {
      int len = 0;
      for(int k = 0; k < d ; k++) {
        int dif = abs(x[i][k] - x[j][k]);
        len += dif*dif;
      }
    }
    bool flag = false;
    for(int i = 0; i < len; i++) {
      if(i*i == len) {
        flag = true;
      }
    }
    if(flag) count++;
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: 'len' was not declared in this scope
   30 |     for(int i = 0; i < len; i++) {
      |                        ^~~
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;
  int x[n][d];
  rep(i, n) rep(j, d) cin >> x[i][j];
  int ans = 0;
  double g = 0;
  rep(i,n-1){
    for(int j=i+1; j＜n; j++){
      g = 0;
      rep(k,d){
        g += (x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
      }
      g = sqrt(g);
      rep(i, sqrt(16000)+1) if(g == i) ans++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'j\U0000ff1cn' was not declared in this scope
   11 |     for(int j=i+1; j＜n; j++){
      |                    ^~~~
Language: C

#include<stdio.h>
int main(void){
int n,d;
  scanf("%d%d",&n,&d);
  double x[n][d],sum=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<d;j++){
scanf("%lf",&x[i][j]);
    }
  }
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      for(int k=0;k<d;k++){
        sum+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
      }
      if(sum-floor(sum)==0)
        ans++;
      sum=0;
    }
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:14: error: implicit declaration of function 'floor' [-Wimplicit-function-declaration]
   16 |       if(sum-floor(sum)==0)
      |              ^~~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'floor'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(void){
main.c:16:14: warning: incompatible implicit declaration of built-in function 'floor' [-Wbuiltin-declaration-mismatch]
   16 |       if(sum-floor(sum)==0)
      |              ^~~~~
main.c:16:14: note: include '<math.h>' or provide a declaration of 'floor'
main.c:17:9: error: 'ans' undeclared (first use in this function)
   17 |         ans++;
      |         ^~~
main.c:17:9: note: each undeclared identifier is reported only once for each function it appears in
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 >> x[i][j];
        }
    }
    int res = 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) res++;
        }
        zout << res << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'zout' was not declared in this scope
   25 |         zout << res << 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));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < D; j++) {
      cin >> X.at(i).at(j);
    }
  }

  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < i; j++) {
      int tmp = 0;
      for (int k = 0; k < N; k++) {
        int tmp2 = X.at(i).at(k) - X.at(j).at(k);
        tmp += tmp2 * tmp2;
      }
      if (sqrt(tmp) = (int)sqrt(tmp)) ans++;
    }
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: lvalue required as left operand of assignment
   22 |       if (sqrt(tmp) = (int)sqrt(tmp)) ans++;
      |           ~~~~^~~~~
Language: C++

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

int main(){
    int n,d;
    cin >> n >> d;
    vector<vector<int>> x(n,<vector<int>(d));
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            cin >> x[i][j]
        }
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
        for (int j = i + 1; j < n; j++){
            int norm = 0;
            for (int k = 0; k < d; k++){
                int diff = abs(x[i][k] - x[j][k]);
                norm += diff * diff;
            }

            bool flag = false;
            for (int k = 0; k <= norm; k++){
                if (k*k == norm){
                    flag = true;
                }
            }
            if (flag){
                ans++;
            }
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected primary-expression before '<' token
    7 |     vector<vector<int>> x(n,<vector<int>(d));
      |                             ^
a.cc:10:27: error: expected ';' before '}' token
   10 |             cin >> x[i][j]
      |                           ^
      |                           ;
   11 |         }
      |         ~
Language: C++

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

int main(){
    int n,d;
    cin >> n >> d;
    vector<vector<int>> x(n,<vector<int>(d));
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            cin >> x[i][j]
        }
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
        for (int j = i + 1; j < n; j++){
            int norm = 0;
            for (int k = 0; k < d; k++){
                int diff = abs(x[i][k] - x[j][k]);
                norm += diff * diff;
            }

            bool flag = false;
            for (int k = 0; k <= norm; k++){
                if (k*k = norm){
                    flag = true;
                }
            }
            if (flag){
                ans++;
            }
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected primary-expression before '<' token
    7 |     vector<vector<int>> x(n,<vector<int>(d));
      |                             ^
a.cc:10:27: error: expected ';' before '}' token
   10 |             cin >> x[i][j]
      |                           ^
      |                           ;
   11 |         }
      |         ~                  
a.cc:24:22: error: lvalue required as left operand of assignment
   24 |                 if (k*k = norm){
      |                     ~^~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <limits.h>
#include <vector>
#include <numeric>

using namespace std;



bool gooddis(long long int n) {

	long long int a = 0;

	while (n >= a * a) {
		if (n == a * a)return true;
		a++;
	}

	return false;
}


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

	vector<vector<int>> x;
	

	for (int i = 0; i < n; i++) {
		vector<int> wk(d);

		for (auto& j : wk)cin >> j;

		x.push_back(wk);
	}

	int ans = 0;

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

			for (int k = 0; k < d; k++) {
				dis += pow((x[i][k] - x[j][k]), 2);
			}

			if (gooddis(dis))ans++;



		}
	}
	
	cout << ans << endl;


	return 0;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:49:40: error: 'pow' was not declared in this scope
   49 |                                 dis += pow((x[i][k] - x[j][k]), 2);
      |                                        ^~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<tuple>
#include<sstream>
#define rep(i,n) for(int i =0;i<(int)(n);i++)
typedef long long ll;
typedef pair<int, int> pp;
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 >> x[i][j];
		}
	}
	int ans = 0;
	rep(i, n) {
		for (int j = i + 1; j < n; j++) {
			int norm = 0;
			rep(k, d) {
				int diff = abs(x[i][k] - x[j][k]);
				norm += diff * diff;
			}
			bool flag = false;
			for (int k = 0; k <= norm; k++) {
				if (k*k == norm) {
					flag = true;
				}
			}
			if (flag)++ans;
		}
	}
	cout << ans << endl;
	
	return 0;
}


Compiler output:
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<int, int> pp;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    intN, D;
    cin >> N >> D;
    vector<vector<int>> X(N, vector<int>(D));
    for (inti = 0; i < N; ++i)
    {
        for (intj = 0; j < D; ++j)
        {
            cin >> X[i][j];
        }
    }
    int ans = 0;
    for (inti = 0; i < N; ++i)
    {
        for (int j = i + 1; j < N; ++j)
        {
            int norm = 0;
            for (intk = 0; k < D; ++k)
            {
                int diff = abs(X[i][k] - X[j][k]);
                norm += diff * diff;
            }
            bool flag = false;
            for (intk = 0; k <= norm; ++k)
            {
                if (k * k == norm)
                {
                    flag = true;
                }
            }
            if (flag)
                ++ans;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'intN' was not declared in this scope; did you mean 'int'?
    5 |     intN, D;
      |     ^~~~
      |     int
a.cc:5:11: error: 'D' was not declared in this scope
    5 |     intN, D;
      |           ^
a.cc:6:12: error: 'N' was not declared in this scope
    6 |     cin >> N >> D;
      |            ^
a.cc:8:10: error: 'inti' was not declared in this scope; did you mean 'int'?
    8 |     for (inti = 0; i < N; ++i)
      |          ^~~~
      |          int
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for (inti = 0; i < N; ++i)
      |                    ^
a.cc:10:14: error: 'intj' was not declared in this scope; did you mean 'int'?
   10 |         for (intj = 0; j < D; ++j)
      |              ^~~~
      |              int
a.cc:10:24: error: 'j' was not declared in this scope
   10 |         for (intj = 0; j < D; ++j)
      |                        ^
a.cc:16:10: error: 'inti' was not declared in this scope; did you mean 'int'?
   16 |     for (inti = 0; i < N; ++i)
      |          ^~~~
      |          int
a.cc:16:20: error: 'i' was not declared in this scope
   16 |     for (inti = 0; i < N; ++i)
      |                    ^
a.cc:21:18: error: 'intk' was not declared in this scope; did you mean 'int'?
   21 |             for (intk = 0; k < D; ++k)
      |                  ^~~~
      |                  int
a.cc:21:28: error: 'k' was not declared in this scope
   21 |             for (intk = 0; k < D; ++k)
      |                            ^
a.cc:27:18: error: 'intk' was not declared in this scope; did you mean 'int'?
   27 |             for (intk = 0; k <= norm; ++k)
      |                  ^~~~
      |                  int
a.cc:27:28: error: 'k' was not declared in this scope
   27 |             for (intk = 0; k <= norm; ++k)
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    intN, D;
    cin >> N >> D;
    vector<vector<int>> X(N, vector<int>(D));
    for (inti = 0; i < N; ++i)
    {
        for (intj = 0; j < D; ++j)
        {
            cin >> X[i][j];
        }
    }
    int ans = 0;
    for (inti = 0; i < N; ++i)
    {
        for (int j = i + 1; j < N; ++j)
        {
            int norm = 0;
            for (intk = 0; k < D; ++k)
            {
                int diff = abs(X[i][k] - X[j][k]);
                norm += diff * diff;
            }
            // check whether norm = k for some k
            bool flag = false;
            for (intk = 0; k <= norm; ++k)
            {
                if (k * k == norm)
                {
                    flag = true;
                }
            }
            if (flag)
                ++ans;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'intN' was not declared in this scope; did you mean 'int'?
    5 |     intN, D;
      |     ^~~~
      |     int
a.cc:5:11: error: 'D' was not declared in this scope
    5 |     intN, D;
      |           ^
a.cc:6:12: error: 'N' was not declared in this scope
    6 |     cin >> N >> D;
      |            ^
a.cc:8:10: error: 'inti' was not declared in this scope; did you mean 'int'?
    8 |     for (inti = 0; i < N; ++i)
      |          ^~~~
      |          int
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for (inti = 0; i < N; ++i)
      |                    ^
a.cc:10:14: error: 'intj' was not declared in this scope; did you mean 'int'?
   10 |         for (intj = 0; j < D; ++j)
      |              ^~~~
      |              int
a.cc:10:24: error: 'j' was not declared in this scope
   10 |         for (intj = 0; j < D; ++j)
      |                        ^
a.cc:16:10: error: 'inti' was not declared in this scope; did you mean 'int'?
   16 |     for (inti = 0; i < N; ++i)
      |          ^~~~
      |          int
a.cc:16:20: error: 'i' was not declared in this scope
   16 |     for (inti = 0; i < N; ++i)
      |                    ^
a.cc:21:18: error: 'intk' was not declared in this scope; did you mean 'int'?
   21 |             for (intk = 0; k < D; ++k)
      |                  ^~~~
      |                  int
a.cc:21:28: error: 'k' was not declared in this scope
   21 |             for (intk = 0; k < D; ++k)
      |                            ^
a.cc:28:18: error: 'intk' was not declared in this scope; did you mean 'int'?
   28 |             for (intk = 0; k <= norm; ++k)
      |                  ^~~~
      |                  int
a.cc:28:28: error: 'k' was not declared in this scope
   28 |             for (intk = 0; k <= norm; ++k)
      |                            ^
Language: C++

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

int main() {
	int n,d,k;
	cin >> n >> d ;
	vector<vector<int>> x(n,vector<int>(d,0));
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<d;j++)
		{
			cin >> x.at(i).at(j);
		}
	}
	int nn = n*(n+1)/2;
	for(int i=0;i<n;i++)
	{
		for(int j=1;j<n;j++)
		{
			int sm =0;
			for(int l=0;l<d;l++)
			{
				int sa = x.at(i).at(l) - x.at(j).at(l).
				sm += sa * sa;
			}
			for(int l=1;l*l<=sm;l++)
			{
				if(l*l == sm)
				{
					k++;
				}
			}
		}
	}
    cout << k << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: request for member 'sm' in '(& x.std::vector<std::vector<int> >::at(((std::vector<std::vector<int> >::size_type)j)))->std::vector<int>::at(((std::vector<int>::size_type)l))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   24 |                                 sm += sa * sa;
      |                                 ^~