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

#include <bits/stdc++.h>
usin namespace std;
int main(){
  int n,all=0;
  cin>>n;
  vector<int> d(n);
  for(int i=0;i<n;i++){
    cin>>d.at(i);
  }
  for(int i;i<n;i++){
    for(int i2;i2<n;i2++){
      all+=d.at(i)*d.at(i2);
    }
  }
  cout<<all<endl;

Compiler output:
a.cc:2:1: error: 'usin' does not name a type
    2 | usin namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> d(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> d(n);
      |          ^~~
a.cc:8:10: error: 'd' was not declared in this scope
    8 |     cin>>d.at(i);
      |          ^
a.cc:12:12: error: 'd' was not declared in this scope
   12 |       all+=d.at(i)*d.at(i2);
      |            ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<all<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<all<endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:18: error: expected '}' at end of input
   15 |   cout<<all<endl;
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main(){
  int n,t;cin>>n;
  vector<int> v(n);
  t=n*(n-1);
  t=t/2;
  vector<int> b(t);
  for(int i=0;i<n;i++){
    cin>>v[i];
  }
  int x=0;
  for(int i=0,;i<n && x<t;i++){
   for(int j=i+1;j<n && x<t;j++){
    b[x]=v[i]*v[j];
     x++;
  }
  }
  int sum=0;
  for(int i=0;i<t;i++){
    sum+=b[i]
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: expected unqualified-id before ';' token
   14 |   for(int i=0,;i<n && x<t;i++){
      |               ^
a.cc:22:14: error: expected ';' before '}' token
   22 |     sum+=b[i]
      |              ^
      |              ;
   23 |   }
      |   ~
Language: C

#include <stdio.h>
int main(void)
{
  int N = 0;
  scanf("%d", &N);
  int d[N] = 0;
  for(int i = 0; i < N; i ++){
    scanf("%d", &d[i]);
  }
  int s = 0;
  for(int j = 0; j < N; j ++){ 
    for(int k = 0; k < N; k ++){
      if(j != k){ 
        s = s + d[j] * d[k];
      }
    }
  }
  printf("%d\n", s);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:14: error: variable-sized object may not be initialized except with an empty initializer
    6 |   int d[N] = 0;
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int i,n;
  cin>>n;
  int A[n],sum=0;
  for(i=0;i<n;i++)
  {
    cin>>A[i];
  }
  int j,k;
  for(k=1;k<n;k++)
  {
    for(j=0;j<k;j++)
    {
      sum=sum+A[k]*A[j];
    }
  }
  cout<<sum;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected '}' at end of input
   21 |   return 0;
      |            ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

int main(){
  int N;
  cin>>N;
  vector<int> D(N); 
  for(int i=0;i<N;i++){
    cin>>D.at(i);
  }
  int sum=0;
  for(int i=0;i<N-1;i++){
    for(int k=i+1;k<N;k++){
        sum+=D.at(i)*D.at(k);
    }
  }
  
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>N;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> D(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> D(N);
      |          ^~~
a.cc:6:10: error: 'D' was not declared in this scope
    6 |     cin>>D.at(i);
      |          ^
a.cc:11:14: error: 'D' was not declared in this scope
   11 |         sum+=D.at(i)*D.at(k);
      |              ^
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<sum<<endl;
      |   ^~~~
a.cc:15:14: error: 'endl' was not declared in this scope
   15 |   cout<<sum<<endl;
      |              ^~~~
Language: C

#include <stdio.h>
int main(void)
{
  int N = 0;
  scanf("%d", &N);
  int d[N] = 0;
  for(int i = 0; i < N; i ++){
    scanf("%d", &d[i]);
  }
  int s = 0;
  for(int j = 0; j < N; j ++){ 
    for(int k = 0; k < N; k ++){
      if(j != k){ 
        s = s + a[j] * a[k];
      }
    }
  }
  printf("%d\n", s)}
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:14: error: variable-sized object may not be initialized except with an empty initializer
    6 |   int d[N] = 0;
      |              ^
main.c:14:17: error: 'a' undeclared (first use in this function)
   14 |         s = s + a[j] * a[k];
      |                 ^
main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:20: error: expected ';' before '}' token
   18 |   printf("%d\n", s)}
      |                    ^
      |                    ;
main.c: At top level:
main.c:19:3: error: expected identifier or '(' before 'return'
   19 |   return 0;
      |   ^~~~~~
main.c:20:1: error: expected identifier or '(' before '}' token
   20 | }
      | ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for (int i = 0; i < N; i++){
    cin >> d[i];
  }
  int sum = 0;
  for ( int i = 0; i < N; i++){
    if ( i = N - 1) break;
    sum += accumulate(d.bigin()+i+1, d.end(), 0)*d[i];
  }
  cout << sum << endl;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   16 |     sum += accumulate(d.bigin()+i+1, d.end(), 0)*d[i];
      |                         ^~~~~
      |                         begin
Language: C++

#include<stdio.h>
int main(){
  int N,i,j,c1,c2;
  scanf("%ld",&N);
  int d[N];
  for(i=1;i<=N;++i){
    scanf("%ld",%d[i]);
  }
  c1=0;
  for(i=1;i<=N;++i){
    for(j=i+1;j<=N;++j){
  c2=+c1+d[i]*d[j];
  c1=c2;
      if(i=N-1){
        break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before '%' token
    7 |     scanf("%ld",%d[i]);
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main(){
   int n;
   cin >> n;
   int d = new int[n];
   for(int i=0;i<n;i++){
     cin >> d[i];
   }
  
  int sumrest=0;
   for(int j=0;j<n;j++){
     for(int k=j;k<n;k++){
       sumrest+=d[j]*d[k];
       }
   }
   cout << sumrest;
   return 0;
}
       
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: invalid conversion from 'int*' to 'int' [-fpermissive]
    7 |    int d = new int[n];
      |                     ^
      |                     |
      |                     int*
a.cc:9:14: error: invalid types 'int[int]' for array subscript
    9 |      cin >> d[i];
      |              ^
a.cc:15:18: error: invalid types 'int[int]' for array subscript
   15 |        sumrest+=d[j]*d[k];
      |                  ^
a.cc:15:23: error: invalid types 'int[int]' for array subscript
   15 |        sumrest+=d[j]*d[k];
      |                       ^
Language: C

#include <stdio.h>

int main(void){
 scanf("%d",n);
 
  int d[n];
  
  for(int i=0;i<n;i++){
 	scanf("%d",&d[n]);
 }
  int sum=0;
  
  
  //1番目と2番目-n番目のせき
  //2番目と3番目-n番目のせき
  //3番目と4番目以降
  //m番目とm+1番目以降の積
  //...
  //n-1番目とn番目の積
  //nになったらおわり
  for(int i=0;i<n;i++){
  	for(int j=i+1;j<n;j++){
     sum += d[i]*d[j];
    }
      
  }
  printf("%d",sum);

}


Compiler output:
main.c: In function 'main':
main.c:4:13: error: 'n' undeclared (first use in this function)
    4 |  scanf("%d",n);
      |             ^
main.c:4:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
 scanf("%d",n);
 
  int d[n];
  
  for(int i=0;i<n;i++){
 	scanf("%d",&d[n])
 }
  int sum=0;
  
  
  //1番目と2番目-n番目のせき
  //2番目と3番目-n番目のせき
  //3番目と4番目以降
  //m番目とm+1番目以降の積
  //...
  //n-1番目とn番目の積
  //nになったらおわり
  for(int i=0;i<n;i++){
  	for(int j=i+1;j<n;j++){
     sum += d[i]*d[j];
    }
      
  }
  printf("%d",sum);

}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: 'n' undeclared (first use in this function)
    4 |  scanf("%d",n);
      |             ^
main.c:4:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:26: error: expected ';' before '}' token
    9 |         scanf("%d",&d[n])
      |                          ^
      |                          ;
   10 |  }
      |  ~
Language: C++

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

int N;
vector<int> D;

int solve(){
    int ans = 0;
    for(int i=0;i<D.size();++i){
        for(int j=i+1;j<D.size();++j){
            ans+=D[i]*D[j];
        }
    }
    return ans;
}

int main(){
    while(cin>>N && N>0){
        D.resize(N);
        for(auto x: N) cin >> x;
        cout << solve() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:21:21: error: 'end' was not declared in this scope; did you mean 'std::end'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: C++

#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>
#include<windows.h>
#define ll long long
using namespace std;
int main()
{
	ll sum = 0;
	int n = 0;
	int a[50];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < n-1; i++)
	{
		for (int j = i+1; j < n; j++)
		{
			sum += a[i] * a[j];
		}
	}
	cout << sum << endl;
}

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

n = int(input())
alist = list(map(int, input().split()))
res = 0
for i in range(n-1):
    for j in range(i+1,n):
        res += alist[i] * alist[j]
print(res)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<stdio.h>

int main()
{
  int t,i,j;
  scanf("%d",&t);
  int a[t+1];
  for(i=1;i<=n;i++)
  {
    scanf("%d",&a[i];
  } 
  long long int sum=0;
  for(i=1;i<=n;i++)
          {
            for(j=i+1;j<=n;j++)
            {
              sum=sum+a[i]*a[j];
            }
          }
          printf("%lld\n",sum);
          
          return 0;
          }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'n' was not declared in this scope
    8 |   for(i=1;i<=n;i++)
      |              ^
a.cc:10:21: error: expected ')' before ';' token
   10 |     scanf("%d",&a[i];
      |          ~          ^
      |                     )
a.cc:13:14: error: 'n' was not declared in this scope
   13 |   for(i=1;i<=n;i++)
      |              ^
Language: C++

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

int N;
vector<int> D;

int solve(){
    int ans = 0;
    for(int i=0;i<D.size();++i){
        for(int j=i+1;j<D.size();++j){
            ans+=D[i]*[j];
        }
    }
    return ans;
}

int main(){
    while(cin>>N && N>0){
        D.resize(N);
        for(auto x: N) cin >> x;
        cout << solve() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:12:26: error: expected '{' before ';' token
   12 |             ans+=D[i]*[j];
      |                          ^
a.cc: In function 'int solve()':
a.cc:12:22: error: no match for 'operator*' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'solve()::<lambda()>')
   12 |             ans+=D[i]*[j];
a.cc: In function 'int main()':
a.cc:21:21: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:21:21: error: 'end' was not declared in this scope; did you mean 'std::end'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;


ll ans=0;

int main(){
	ll N;
	cin >> N;
	ll d[N];
	ll D = 0;
	REP(i,0,N){
		cin >> a;
		d[i] = a;
		D += d[i];
	}
	REP(i,0,N){
		D = D - d[i];
		ans += d[i]*D;
	}
	
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'a' was not declared in this scope
   17 |                 cin >> a;
      |                        ^
Language: C++

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
using namespace std;
int main(){
  fast;
  int n,sum=0;
  ll ans=0;
  cin>>n;
  vecector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  for(int i=0;i<n-1;i++){
    sum-=a[i];
    ans+=(a[i]*1LL*sum);
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vecector' was not declared in this scope
   10 |   vecector<int> a(n);
      |   ^~~~~~~~
a.cc:10:12: error: expected primary-expression before 'int'
   10 |   vecector<int> a(n);
      |            ^~~
a.cc:12:10: error: 'a' was not declared in this scope
   12 |     cin>>a[i];
      |          ^
a.cc:16:10: error: 'a' was not declared in this scope
   16 |     sum-=a[i];
      |          ^
Language: C++

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
using namespace std;
int main(){
  fast;
  int n,sum=0;
  ll ans=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  for(int i=0;i<n-1;i++){
    sum-=a[i];
    ans+=(a[i]*1LL*sum);
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'a' was not declared in this scope
   11 |     cin>>a[i];
      |          ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |     sum-=a[i];
      |          ^
Language: C++

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

int N;
vector<int> D;

int solve(){
    int ans = 0;
    for(int i=0;i<D.size();++i){
        for(int j=i+1;j<D.size();++j){
            ans+=x*y;
        }
    }
    return ans;
}

int main(){
    while(cin>>N && N>0){
        D.resize(N);
        for(auto x: N) cin >> x;
        cout << solve() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:12:18: error: 'x' was not declared in this scope
   12 |             ans+=x*y;
      |                  ^
a.cc:12:20: error: 'y' was not declared in this scope
   12 |             ans+=x*y;
      |                    ^
a.cc: In function 'int main()':
a.cc:21:21: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:21:21: error: 'end' was not declared in this scope; did you mean 'std::end'?
   21 |         for(auto x: N) cin >> x;
      |                     ^
      |                     std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: C++

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
using namespace std;
int main(){
  fast;
  int n,sum=0;
  ll ans=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  for(int i=0;i<n-1;i++){
    sum-=a[i];
    ans+=(a[i]*1LL*sum);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'a' was not declared in this scope
   11 |     cin>>a[i];
      |          ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |     sum-=a[i];
      |          ^
Language: Java

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

		int d[] = new int[n];
		
		for(int i=0; i<n; i++) {
			d[i] = sc.nextInt();
		}
		
		int p = 0;
		for (int i=0; i<n-1;i++) {
			for(int j=i+1;j<n;j++) {
				p += d[i]*d[j];
			}
		}
		
		System.out.println(p);
	}

}


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

#include <iostream>
using namespace std;

int main() {
	int N;
  cin>>N;
  vector<int>vec(N);
  int ans=0;
  for(int ia=0 ;ia<N-1;ia++){
for(int ib=ia+1; ib<N ;ib++){
  ans+=ia*ib;
}
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>vec(N);
      |          ^~~
Language: C++

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using E = System.Linq.Enumerable;
 
class Program
 {
  
        static void Main(string[] args)
        {
          //入力を受け取る
          int N = int.Parse(Console.ReadLine());
          int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
          long sum = 0;
          for(int i = 0; i < N ;i++){
            for(int j = i+1; j < N ;j++){
              sum += d[i]*d[j];
            }
          }
          Console.Write(sum);
        }
  
 }

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Text;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:5:11: error: 'System' does not name a type
    5 | using E = System.Linq.Enumerable;
      |           ^~~~~~
a.cc:10:26: error: 'string' has not been declared
   10 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:10:35: error: expected ',' or '...' before 'args'
   10 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:24:3: error: expected ';' after class definition
   24 |  }
      |   ^
      |   ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:13:19: error: expected primary-expression before 'int'
   13 |           int N = int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:14:14: error: structured binding declaration cannot have type 'int'
   14 |           int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
      |              ^~
a.cc:14:14: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:14: error: empty structured binding declaration
a.cc:14:17: error: expected initializer before 'd'
   14 |           int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
      |                 ^
a.cc:18:22: error: 'd' was not declared in this scope
   18 |               sum += d[i]*d[j];
      |                      ^
a.cc:21:11: error: 'Console' was not declared in this scope
   21 |           Console.Write(sum);
      |           ^~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long int n,i,j,sum=0;
  cin>>n;
  vector<int>a(n);
  for(i=0;i<n;i++){
    cin>>a[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      sum=sum+a[i]*a[j];
    }
  }
  cout<<sum<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>a(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>a(n);
      |          ^~~
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     cin>>a[i];
      |          ^
a.cc:12:15: error: 'a' was not declared in this scope
   12 |       sum=sum+a[i]*a[j];
      |               ^
Language: C++

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using E = System.Linq.Enumerable;
 
class Program
 {
  
        static void Main(string[] args)
        {
          //入力を受け取る
          int N = int.Parse(Console.ReadLine());
          int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
          int sum = 0;
          for(int i = 0; i < N ;i++){
            for(int j = i+1; j < N ;j++){
              sum += d[i]*d[j];
            }
          }
          Console.Write(sum);
        }
  
 }

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Text;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:5:11: error: 'System' does not name a type
    5 | using E = System.Linq.Enumerable;
      |           ^~~~~~
a.cc:10:26: error: 'string' has not been declared
   10 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:10:35: error: expected ',' or '...' before 'args'
   10 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:24:3: error: expected ';' after class definition
   24 |  }
      |   ^
      |   ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:13:19: error: expected primary-expression before 'int'
   13 |           int N = int.Parse(Console.ReadLine());
      |                   ^~~
a.cc:14:14: error: structured binding declaration cannot have type 'int'
   14 |           int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
      |              ^~
a.cc:14:14: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:14: error: empty structured binding declaration
a.cc:14:17: error: expected initializer before 'd'
   14 |           int[] d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
      |                 ^
a.cc:18:22: error: 'd' was not declared in this scope
   18 |               sum += d[i]*d[j];
      |                      ^
a.cc:21:11: error: 'Console' was not declared in this scope
   21 |           Console.Write(sum);
      |           ^~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
void main()
{
  int n;
  cin>>n;
  int arr[n];
  for (int i=0;i<n;i++)
    cin>>arr[i];
  int sum=0;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      if(i!=j)
      {
        int prod=i*j;
        sum+=prod;
      }
    }
  }
    cout<<sum;
}
  


Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for(int i=0;i<N;++i){
   cin >> d.at(i);
  }
 int S=0;
  for(int i=0;i<N;++i){
    for(int j=i+1;j<N;++j){
    S+=d.at(i)*d.at(j)
    }
  }
  cout<<S<<endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected ';' before '}' token
   14 |     S+=d.at(i)*d.at(j)
      |                       ^
      |                       ;
   15 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
  cin>>>n;
  int arr[n];
  for(int i=0;i<n;i++){
  cin>>arr[i];
  }
  int s=0;
  for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
  s+=arr[i]*arr[j];
  }
    cout<<s<<endl;
  }
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected primary-expression before '>' token
    5 |   cin>>>n;
      |        ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
void main()
{
  int n;
  cin>>n;
  int arr[n];
  for (int i=0;i<n;i++)
    cin>>arr[i];
  int sum=0;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      if(i!=j)
      {
        int prod=i*j;
        sum+=prod;
      }
    }
    cout<<sum;
  }
  


Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++)
    cin>>v[i];
  long long ans=0;
  for(int i=0;i<n;i++){
    for(int j=i+1;<n;j++){
      ans+=(v[i]*v[j]);
    }}
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before '<' token
   11 |     for(int j=i+1;<n;j++){
      |                   ^
Language: C++

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

int main()
{
  int n;
  cin >> n;
  vector<int> d(n);
  for(auto& i : d) cin >> i;
  
  int ans = 0;
  for(int x = 0; x < n - 1; ++x)
  {
    for(int y = x + 1; y < n; ++y)
    {
      ans += n[x] * n[y];
    }
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: invalid types 'int[int]' for array subscript
   16 |       ans += n[x] * n[y];
      |               ^
a.cc:16:22: error: invalid types 'int[int]' for array subscript
   16 |       ans += n[x] * n[y];
      |                      ^
Language: C++

#include<iostream>
#include<stdio.h>

void main()
{
  int n;
  cin>>n;
  int arr[n];
  for (int i=0;i<n;i++)
    cin>>arr[i];
  int sum=0;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
      if(i!=j)
      {
        int prod=i*j;
        sum+=prod;
      }
    }
    cout<<sum;
  }
  

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |     cout<<sum;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#inclulde<iostream>
#include<vector>
using namespace std;
int main(){
  long long n,ans=0;
  cin>>n;
  vector<long long> a(n),b(n*(n-1)/2);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int k=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n-i-1;j++){
      ans+=a[i]*a[j+1];
    }
  }
  cout<<ans<<endl;
  return 0;
}

  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclulde; did you mean #include?
    1 | #inclulde<iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<vector>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout<<ans<<endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:14: error: 'endl' was not declared in this scope
   17 |   cout<<ans<<endl;
      |              ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<vector>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int count=0;
int vec[n];
for(int i=0;i<n;i++)cin>>vec(i);
for(int i=0;i<n-1;i++){
    for(int a=i+1;a<n;a++){
        count=count+vec(i)*vec(a);
    }
}
cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'vec' cannot be used as a function
    9 | for(int i=0;i<n;i++)cin>>vec(i);
      |                          ~~~^~~
a.cc:12:24: error: 'vec' cannot be used as a function
   12 |         count=count+vec(i)*vec(a);
      |                     ~~~^~~
a.cc:12:31: error: 'vec' cannot be used as a function
   12 |         count=count+vec(i)*vec(a);
      |                            ~~~^~~
Language: C++

n = int(input())
d = [int(i) for input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
n = s.size()
for i in range(n):
	print(s[i])

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int count=0;
vector<int>vec(n);
for(int i=0;i<n;i++)cin>>vec(i);
for(int i=0;i<n-1;i++){
    for(int a=i+1;a<n;a++){
        count=count+vec(i)*vec(a);
    }
}
cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int>vec(n);
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vector<int>vec(n);
      |        ^~~
a.cc:9:26: error: 'vec' was not declared in this scope
    9 | for(int i=0;i<n;i++)cin>>vec(i);
      |                          ^~~
a.cc:12:21: error: 'vec' was not declared in this scope
   12 |         count=count+vec(i)*vec(a);
      |                     ^~~
Language: C++

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sum,n,v[N];
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n;
    for(int i = 0; i < n; i++) cin >> v[i];
    for(int i = 0; i < n; i++) for(int j = 0; j < i; j++) res += v[i]*v[j];
    cout << res << '\n';
}


Compiler output:
a.cc:6:12: error: 'N' was not declared in this scope
    6 | ll sum,n,v[N];
      |            ^
a.cc: In function 'int main()':
a.cc:10:39: error: 'v' was not declared in this scope
   10 |     for(int i = 0; i < n; i++) cin >> v[i];
      |                                       ^
a.cc:11:59: error: 'res' was not declared in this scope
   11 |     for(int i = 0; i < n; i++) for(int j = 0; j < i; j++) res += v[i]*v[j];
      |                                                           ^~~
a.cc:11:66: error: 'v' was not declared in this scope
   11 |     for(int i = 0; i < n; i++) for(int j = 0; j < i; j++) res += v[i]*v[j];
      |                                                                  ^
a.cc:12:13: error: 'res' was not declared in this scope
   12 |     cout << res << '\n';
      |             ^~~
Language: C++

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

int main() {
  int N;
  std::cin >> N;
  
  std::vector<int> vec(N);
  for (auto& v : vec) {
    std::cin >> v;
  }
  
  int result = 0;
  for (int i = 0; i < N - 1; ++i) {
	for (int j = i + 1; j < N; ++j) {
      result + = vec[i] * vec[j];
    }
  }
  
  std::cout << result;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expected primary-expression before '=' token
   17 |       result + = vec[i] * vec[j];
      |                ^
Language: C++

#define _USE_MATH_DEFINES
 
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
 
#include <bits/stdc++.h> 
 
using namespace std;
 
#define len(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl '\n'
#define x first
#define y second
#define int long long
#define double long double
#define vi vector<int> 
#define vvi vector<vector<int>>
#define pb push_back
#define pii pair<int, int>
#define beg begin
 
#ifdef LOCAL
    #define dbg(x) cout << #x << " = " << x << endl;
#else 
    #define dbg(x)
#endif 
 
template<class T> istream& operator>>(istream &str, vector<T> &a) {
	for (auto &i : a) {
		str >> i; 
	}
	return str;
}
 
void solve(); signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);                                       
    freopen("output.txt", "w", stdout);
#endif
    srand(time(0));
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout.setf(ios::fixed); cout.precision(0);
    solve();    
}
 
const int INF = 1e18, MAXN = 3e5 + 10, MOD = 1e9 + 7;

void solve() {
	int sum = 0;

	int n; cin >> n;
	vi a(n);
	cin >> a;

	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			sum += d[i] * d[j];
		}
	}

	cout << sum << endl;
}	

Compiler output:
a.cc: In function 'void solve()':
a.cc:61:32: error: 'd' was not declared in this scope
   61 |                         sum += d[i] * d[j];
      |                                ^
Language: C++

#include<bits/stdc++.h>
namespace ZDY{
    #pragma GCC optimize(3)
    #define il __inline__ __attribute__ ((always_inline))
    #define rg register
    #define ll long long
    #define ull unsigned long long
    #define db double
    #define sht short
    #define MB template <class T>il
    #define Fur(i,x,y) for(int i=x;i<=y;i++)
    #define Fdr(i,x,y) for(int i=x;i>=y;i--)
    #define fl(i,x) for(int i=head[x],to;to=e[i].to,i;i=e[i].nxt)
    #define clr(x,y) memset(x,y,sizeof(x))
    #define cpy(x,y) memcpy(x,y,sizeof(x))
    #define fin(s) freopen(s".in","r",stdin)
    #define fout(s) freopen(s".out","w",stdout)
    #define fcin ios::sync_with_stdio(false)
    #define l2(n) ((int)(log2(n)))
    #define inf 0x3f3f3f3f
    MB T ABS(T x){return x>0?x:-x;}
    MB T MAX(T x,T y){return x>y?x:y;}
    MB T MIN(T x,T y){return x<y?x:y;}
    MB T GCD(T x,T y){return y?GCD(y,x%y):x;}
    MB void SWAP(T &x,T &y){T t=x;x=y;y=t;}
}using namespace ZDY;using namespace std;
namespace IO{const char* ln="\n";const int str=1<<20;struct IN{char buf[str],*s,*t;bool _;IN():s(buf),t(buf),_(0){}il char gc(){return s==t&&((t=(s=buf)+fread(buf,1,str,stdin))==s)?EOF:(*s++);}IN&operator>>(char&ch){if(_)return *this;char c;while((c=gc())!=EOF&&isspace(c));if(c==EOF)_=1;else ch=c;return *this;}IN& operator>>(char* ch){clr(ch,0);if(_)return *this;char c;while((c=gc())!=EOF&&isspace(c));if(c==EOF)return _=1,*this;*ch=c;ch++;while((c=gc())!=EOF&&!isspace(c))*ch=c,ch++;if(c==EOF)_=1;return *this;}IN& operator>>(string& ch){if(_)return *this;char c;while((c=gc())!=EOF&&isspace(c));if(c==EOF)return _=1,*this;ch+=c;while((c=gc())!=EOF&&!isspace(c))ch+=c;if(c==EOF)_=1;return *this;}template<typename T>IN&operator>>(T&x){if(_)return *this;char c=gc();bool ff=0;while(c!=EOF&&(c<'0'||c>'9'))ff^=(c=='-'),c=gc();if(c==EOF){_=1;return *this;}x=0;while(c!=EOF&&'0'<=c&&c<='9')x=(x<<3)+(x<<1)+c-48,c=gc();if(c==EOF)_=1;if(ff)x=-x;return *this;}}in;struct OUT{char buf[str],*s,*t;OUT():s(buf),t(buf+str){}~OUT(){fwrite(buf,1,s-buf,stdout);}void pt(char c){(s==t)?(fwrite(s=buf,1,str,stdout),*s++=c):(*s++=c);}OUT&operator<<(const char*s){while(*s)pt(*s++);return *this;}OUT&operator<<(char*s){while(*s)pt(*s++);return *this;}OUT&operator<<(string s){for(int i=0;s[i];i++)pt(s[i]);return *this;}template<typename T>OUT&operator<<(T x){if(!x)return pt('0'),*this;if(x<0)pt('-'),x=-x;char a[30],t=0;while(x)a[t++]=x%10,x/=10;while(t--)pt(a[t]+'0');return *this;}}out;}using namespace IO;
#define N 111
#define int ll
int n,a[N];
int main(){
    in>>n;
    int s=0,ans=0;
    Fur(i,1,n)in>>a[i],s+=a[i];
    Fur(i,1,n)ans+=a[i]*(s-a[i]);
    ans>>=1;
    out<<ans<<ln;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;
int A[50]
int main(){
  int n;
  cin>>n;
  for(int i = 0;i < n; i ++)cin>>A[i];
  int ans = 0;
  for(int i = 0 ; i < n ; i ++){
  	for(int j = i+1 ; j < n ; j ++){
    	ans += A[i]*A[j];
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

#include <iostream>
using namespace std;

int main() {
  int N;
  int d[70];
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> d[i];
  int total = 0;
  
    for (int b = 0; b <= N; ++b) {
      for (int c = 0; c <= N; ++c) {
        if(b != c){
        int total += d[b] * d[c]; // 合計値
        }
      }
    }
  
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected initializer before '+=' token
   14 |         int total += d[b] * d[c]; // 合計値
      |                   ^~
Language: C++

# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

n = int(input())
d = list(int(i) for i in input().split())

ans = 0
for l in range(n):
  for r in range(l + 1, n):
    if l == r:
      continue
    else:
      ans += (d[l] * d[r])

print(ans)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #submission
    2 | # submission # - User: herp_sy
      |   ^~~~~~~~~~
a.cc:3:3: error: invalid preprocessing directive #https
    3 | # https://atcoder.jp/contests/
      |   ^~~~~
a.cc:5:3: error: invalid preprocessing directive #lang
    5 | # lang: Python3 (3.4.3)
      |   ^~~~
a.cc:7:1: error: 'import' does not name a type
    7 | import math
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,i,j,d=0;
  cin >> a;
  int b[a];
  for(i=0;i<n;i++){
    cin >> b[i];
  }
  for(i=0;i<a;i++){
    for(j=0;j<a;j++){
      d=d+b[i]*b[j];
    }
  }
  cout << d << endl;
}


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

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

int main () {
  int N;
  long long ans;
  vector<int>d(N);
  for (int i = 0; i < N; i++) {
    cin >> d.at(i);
  }
  for (int i = 0; i < N; i++) {
    for (int i = j + 1; j < N; j++) {
      ans += d.at(i) * d.at(j);
    }
  }
  cout << ans;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>d(N);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>d(N);
      |          ^~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> d.at(i);
      |     ^~~
a.cc:9:12: error: 'd' was not declared in this scope
    9 |     cin >> d.at(i);
      |            ^
a.cc:12:18: error: 'j' was not declared in this scope
   12 |     for (int i = j + 1; j < N; j++) {
      |                  ^
a.cc:13:14: error: 'd' was not declared in this scope
   13 |       ans += d.at(i) * d.at(j);
      |              ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << ans;
      |   ^~~~
Language: C++

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

int main(){
  int n,i,a,wa=0,nijo=0;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>a;
    wa+=a;
    nijo+=a**2
  }
  cout<<wa**2-nijo;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid type argument of unary '*' (have 'int')
   10 |     nijo+=a**2
      |             ^~
a.cc:12:12: error: invalid type argument of unary '*' (have 'int')
   12 |   cout<<wa**2-nijo;
      |            ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

  int N; cin>>N;
  vector<int> D(N); for (auto& d : D) cin>>d;
  
  int ans = 0;
  for (int i = 0; i < N; i++) for (j = i+1; j < N; j++) {
    ans += D[i]*D[j];
  }
  cout << ans << endl;

  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
auto ____ = [] () {ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); };
const int MAXN = 55;
int n,A[MAXN];

int main(){
    ____();
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> A[i];
    int tot = 0;
    for(int i = 1; i <= n; i++) for(int j = i+1; j <= n; j++) tot += A[i] * A[j];
    cout << toot << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'toot' was not declared in this scope; did you mean 'tot'?
   13 |     cout << toot << endl;
      |             ^~~~
      |             tot
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include <stdio.h>
#include<iostream>
#include<iomanip>
#include<cmath>
#include<array>
#include<vector>
#include<set>
#include <utility>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
#include <iostream>
using namespace std;

/* 入力 */

int main() {
  int n;
  cin>>n;
  int d[110];
  for (int i=0;i<n;i++)
  cin>>d[i];

  int sum=0;

  for(int i=0;i<n;i++){
    for(int j=0;j<n&&7
5 0 7 8 3 3 2j!=i;j++){
      sum+=d[i]*d[j];
    }
  }

  cout<<sum<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: expected ';' before numeric constant
   31 |     for(int j=0;j<n&&7
      |                       ^
      |                       ;
   32 | 5 0 7 8 3 3 2j!=i;j++){
      | ~                      
a.cc:32:2: error: expected ')' before numeric constant
   32 | 5 0 7 8 3 3 2j!=i;j++){
      |  ^~
      |  )
a.cc:31:8: note: to match this '('
   31 |     for(int j=0;j<n&&7
      |        ^
a.cc:32:4: error: expected ';' before numeric constant
   32 | 5 0 7 8 3 3 2j!=i;j++){
      |    ^~
      |    ;
a.cc:32:19: error: 'j' was not declared in this scope
   32 | 5 0 7 8 3 3 2j!=i;j++){
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a;
  cin>>a;
  int arr[a];
  for(int i=0;i<a;i++)
    cin>>arr[i];
  int sum=0;
  for(int i=0;i<a;i++)
    for(int j=i+1;j<a;j++)
      sum+=(arr[i]*arr[j])
  cout<<sum<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before 'cout'
   13 |       sum+=(arr[i]*arr[j])
      |                           ^
      |                           ;
   14 |   cout<<sum<<"\n";
      |   ~~~~
Language: C++

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

typedef long long ll;

#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    int N;
    int[50] d;
    ll ans = 0;
    rep(i, N) {
        for (int j = i + 1; j < N; j++) {
            ans += d[i] * d[j];
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected identifier before numeric constant
   11 |     int[50] d;
      |         ^~
a.cc:11:9: error: expected ']' before numeric constant
   11 |     int[50] d;
      |         ^~
      |         ]
a.cc:11:8: error: structured binding declaration cannot have type 'int'
   11 |     int[50] d;
      |        ^
a.cc:11:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:8: error: empty structured binding declaration
a.cc:11:13: error: expected initializer before 'd'
   11 |     int[50] d;
      |             ^
a.cc:15:20: error: 'd' was not declared in this scope
   15 |             ans += d[i] * d[j];
      |                    ^