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

#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <limits.h>
#include <bitset>
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 1000000007;
const int INF = LLONG_MAX/3;
const int MAX = 510000;
signed main(){
    int a,b;
    cin>>a>>b;
    cout<<max(0,a-2*b)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: no matching function for call to 'max(int, long long int)'
   29 |     cout<<max(0,a-2*b)<<endl;
      |           ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:29:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   29 |     cout<<max(0,a-2*b)<<endl;
      |           ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:29:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     cout<<max(0,a-2*b)<<endl;
      |           ~~~^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> d(n);
	int i,s,count = 0;
	for(i = 0;i < n;i++)cin >> d.at(i);
	for(i = 0;i < n-1;i++){
		for(s = i+1;s < n;s++){
			count += d.at(i) * d.at(s);
		}
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> d(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:16: error: expected primary-expression before 'int'
    7 |         vector<int> d(n);
      |                ^~~
a.cc:9:36: error: 'd' was not declared in this scope
    9 |         for(i = 0;i < n;i++)cin >> d.at(i);
      |                                    ^
a.cc:12:34: error: 'd' was not declared in this scope
   12 |                         count += d.at(i) * d.at(s);
      |                                  ^
Language: C++

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

int main()
{
  int n;
  long long ans = 0;
  vector<int> d;
  cin >> n;
  for(int i=0; i<n; i++)
  {
    int di;
    cin >> di;
    d.push_back(d);
  }
  
  for(int i=0; i<n-1; i++)
  {
    for(int j=i+1; i<n; j++)
    {
      ans += d[i] * d[j];
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>&)'
   15 |     d.push_back(d);
      |     ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

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

int main(){
  long long int N ,ans = 0 ;
  string S ;
  cin >> N ;
  for(int i = 1; i < N; i++)
    for(int j = 0; j < i; j++)
      ans += d[i] * d[j];
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'd' was not declared in this scope
   10 |       ans += d[i] * d[j];
      |              ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] d = new int[n];
		for(int i=0; i<n; i++){
			d[i] = scn.nextInt();
		}
      	int sum = 0;
      	for(int i=0; i<n-1; i++){
          for(int j=i+1; j<n; j++){
            sum += a[i]*a[j];
          }
        }
      	System.out.println(sum);
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
            sum += a[i]*a[j];
                   ^
  symbol:   variable a
  location: class Main
Main.java:14: error: cannot find symbol
            sum += a[i]*a[j];
                        ^
  symbol:   variable a
  location: class Main
2 errors
Language: C++

using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> d(n);
    for (int i = 0; i < n; i++) {
        cin >> d[i];
    }

    long  long sum = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i; j < n  -1; j++) {
            sum += i*j;
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> d(n);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> d(n);
      |            ^~~
a.cc:7:16: error: 'd' was not declared in this scope
    7 |         cin >> d[i];
      |                ^
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << sum << endl;
      |     ^~~~
a.cc:16:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |     cout << sum << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main() {
  int n, S = 0;
  cin >> n;
  vector<int> v(n);
  for(int i = 0;i < n;i++) {
    cin >> v[i];
  }
  for(int i = 0;i < n;i++) {
    for(int j = i + 1;j < n;J++) {
      S += v[i] * v[j];
    }
  }
  cout << S << endl;
}

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

#include <iostream>
#include <vector>
#include <queue>

using lli = long long int;
std::vector<lli> vec;
lli ans;
lli n;

int main() {
  ans = 0;
  std::cin >> n;
  vec.assign(n, 0);
  for (int i = 0; i < n; i++) {
    std::cin >> d;
    vec[i] = d;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i >= j) {
        continue;
      }
      ans += (vec[i]+vec[j]);
    }
  }
  std::cout << ans << std::endl;
  
}

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

#include <iostream>
#include <vector>
#include <queue>

using lli = long long int;
std::vector<lli> vec;
lli ans;

int main() {
  ans = 0;
  std::cin >> n;
  vec.assign(n, 0);
  for (int i = 0; i < n; i++) {
    std::cin >> d;
    vec[i] = d;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i >= j) {
        continue;
      }
      ans += (vec[i]+vec[j]);
    }
  }
  std::cout << ans << std::endl;
  
}

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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std; 
#define ll long long
#define pb push_back
#define F first
#define S second
#define all(c)  c.begin(), c.end()
#define mp make_pair
#define endl "\n"
#define N (ll)2e5+10 




int main(){
    
    ios::sync_with_stdio(0);
    
    int n ;
    cin >> n ;
    int d[n] ;
    for(i=0 ; i<n ; i++){
    	cin >> d[i] ;
    }
    int ans = 0 ;
    for(i=0  ; i<n ; i++){
    	for(j=i+1 ; j<n ; j++){
    		ans += d[i]*d[j] ;
    	}
    }
    cout << ans ;

    return 0 ;
 }

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

#include <iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
	vector<int> d(n)
    for (int i=0; i<n; i++){
        cin >> d[i];
    }
    int ans = 0;
    for (int i=0; i<n; i++){
        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:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> d(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:16: error: expected primary-expression before 'int'
    7 |         vector<int> d(n)
      |                ^~~
a.cc:8:19: error: 'i' was not declared in this scope
    8 |     for (int i=0; i<n; i++){
      |                   ^
a.cc:14:20: error: 'd' was not declared in this scope
   14 |             ans += d[i]*d[j]
      |                    ^
Language: C++

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


int main(){
  int N ;
  cin >> N ; 
  vector<int> d(N) ; 
  int cnt = 0 ; 
  
  for ( int i = 0 ; i < N ; i++){
    cin >> d(i) ; 
  }
  
  for(int i = 0 ; i < N ; i++){
    for(int j = i+1 ; j < N ; j++){
      cnt = cnt + d(i)*d(j) ; 
    }
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: no match for call to '(std::vector<int>) (int&)'
   12 |     cin >> d(i) ;
      |            ~^~~
a.cc:17:20: error: no match for call to '(std::vector<int>) (int&)'
   17 |       cnt = cnt + d(i)*d(j) ;
      |                   ~^~~
a.cc:17:25: error: no match for call to '(std::vector<int>) (int&)'
   17 |       cnt = cnt + d(i)*d(j) ;
      |                        ~^~~
Language: C++

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

int main() {
    int N;
    cin >> N;
　　vector<int> vec(N);
  　int tairyoku;
　　for (int i = 0; i < N; i++) {
　  cin >> vec.[i];
  }
   for (int j = 0; j < N; j++){
     for (int k = 0; k < N; k++){
       tairyoku += vec.[j]*vec.[k]/2;
     }
   }
       
     
     cout << tairyoku << endl;
}


Compiler output:
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | 　　vector<int> vec(N);
      | ^
a.cc:7:1: error: extended character 　 is not valid in an identifier
a.cc:8:3: error: extended character 　 is not valid in an identifier
    8 |   　int tairyoku;
      |   ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　　for (int i = 0; i < N; i++) {
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　  cin >> vec.[i];
      | ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000\U00003000vector' was not declared in this scope
    7 | 　　vector<int> vec(N);
      | ^~~~~~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 | 　　vector<int> vec(N);
      |            ^~~
a.cc:8:3: error: '\U00003000int' was not declared in this scope
    8 |   　int tairyoku;
      |   ^~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 | 　　for (int i = 0; i < N; i++) {
      |          ^~~
a.cc:9:21: error: 'i' was not declared in this scope
    9 | 　　for (int i = 0; i < N; i++) {
      |                     ^
a.cc:14:8: error: 'tairyoku' was not declared in this scope
   14 |        tairyoku += vec.[j]*vec.[k]/2;
      |        ^~~~~~~~
a.cc:14:20: error: 'vec' was not declared in this scope
   14 |        tairyoku += vec.[j]*vec.[k]/2;
      |                    ^~~
a.cc:14:24: error: expected unqualified-id before '[' token
   14 |        tairyoku += vec.[j]*vec.[k]/2;
      |                        ^
a.cc:14:32: error: expected unqualified-id before '[' token
   14 |        tairyoku += vec.[j]*vec.[k]/2;
      |                                ^
a.cc:19:14: error: 'tairyoku' was not declared in this scope
   19 |      cout << tairyoku << endl;
      |              ^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int a[56];
int main () {
  int N;
  cin >> N;
  for (int i=0; i<N; i++) {
    cin >> a[i];
  }
  long long int sum=0;
  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 'int main()':
a.cc:13:12: error: 'd' was not declared in this scope
   13 |       sum+=d[i]*d[j];
      |            ^
Language: C++

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


int main() {
  int n; cin >> n;
  int d[n];
  int D[n];
  for(int i = 0; i < n; i++){
    cin >> d[i];
    D[i] = d[i];
  }
  int sum = 0;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(i!=j){
        sum += d[i]*D[j];
      }
    }
  }
  if(sum%2==0) cout << sum/2 << endl;
  else cout << sum/2+i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: 'i' was not declared in this scope
   22 |   else cout << sum/2+i << endl;
      |                      ^
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 >> a.at(i);
  int ans = 0;
  for(int i = 0; i<n; i++){
    for(int j = i+1; j<n; j++) ans += d.at(i) * d.at(j);
  }
  cout << ans << endl;
}

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

#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi   = vec<int>;
using vvi  = vec<vi>;
using vvvi = vec<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int n;cin>>n;
  vi d(n);
  rep(i,n) cin>>d[i];
  ll ret = 0;
  rep(i,n){
    for(int j=i+1;j<n;++j)
      ret += d[i]*d[j];
    }
  }
  cout << ret << endl;
  return 0;
}


Compiler output:
a.cc:83:3: error: 'cout' does not name a type
   83 |   cout << ret << endl;
      |   ^~~~
a.cc:84:3: error: expected unqualified-id before 'return'
   84 |   return 0;
      |   ^~~~~~
a.cc:85:1: error: expected declaration before '}' token
   85 | }
      | ^
Language: C++

#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi   = vec<int>;
using vvi  = vec<vi>;
using vvvi = vec<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int n;cin>>n;
  vi d(n);
  rep(i,n) cin>>d[i];
  ll ret = 0;
  rep(i,n){
    for(int i=j+1;j<n;++j)
      ret += d[i]*d[j];
    }
  }
  cout << ret << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:15: error: 'j' was not declared in this scope
   79 |     for(int i=j+1;j<n;++j)
      |               ^
a.cc: At global scope:
a.cc:83:3: error: 'cout' does not name a type
   83 |   cout << ret << endl;
      |   ^~~~
a.cc:84:3: error: expected unqualified-id before 'return'
   84 |   return 0;
      |   ^~~~~~
a.cc:85:1: error: expected declaration before '}' token
   85 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int d[n];
	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;j++){
			if(i!=j){
				sum+=d[i]*d[j];
		}
	}
	cout<<sum/2;
}

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

#include <bits/stdc++.h>
#include <sstream>
#include <iomanip>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;

const double pi = 3.14159265359;
const ll INF = 1e12;
const ll MOD = 1e9 + 7;
const ll N = 1e5 + 5;
/*
Decimal Places: cout << fixed << setprecision(n) << ans << endl

String to integer:
stringstream dark(s);
int x = 0; dark >> x;
*/

bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.second < j.second;
}


int n, d[50], ans=0;

void solve()
{
    cin >> n;
    for (int i=0; i<n; i++) cin >> d[i];
    for (int i=0; i<n; i++) {
        for (int j=i+1; j<n; j++) ans+=a[i]*a[j];
    }nout(ans);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    //cin >> t;
    for (int i=1; i<=t; i++)
    {
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:40: error: 'a' was not declared in this scope
   39 |         for (int j=i+1; j<n; j++) ans+=a[i]*a[j];
      |                                        ^
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[i];
    }
    int res = 0;
    for(int i = 0; i < N; i++) {
        for(int j = i+1; j < N; j++) {
            res+=d[i]*d[j];
        }
    }
    cout << res << endl;
}

Compiler output:
a.cc:1:25: error: missing terminating > character
    1 | #include <bits/stdc++.h.
      |                         ^
a.cc:1:10: fatal error: bits/stdc++.h.: No such file or directory
    1 | #include <bits/stdc++.h.
      |          ^
compilation terminated.
Language: C++

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

int main() {
int N;
int ans = 0;
cin >> N;
vector<int>takoyakies(n);
for(int i = 0; i < N; i++){
    cin >> takoyakies.at(i);
}

for(int i = 0; i < N; i++) {
    for(int j = i + 1; j < N; j++) {
        ans += takoyakies.at(i) * takoyakies.at(j);
    }
 }
cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'n' was not declared in this scope
    8 | vector<int>takoyakies(n);
      |                       ^
Language: C++

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


int main() {
int n,sum=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}

for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
        sum=sum+a[i]*a[j];
    }
}
cout<<sum<<endl;
return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected '}' at end of input
   19 | return 0;
      |          ^
a.cc:5:12: note: to match this '{'
    5 | int 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[I];
    int ans = 0;
  	for(int I = 0; I < N; I++) {
  	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:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

int main(){
  int N ; cin >> N ;
  vector<int> D(55);
  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;j++){
      sum += D[i]*D[j];
    }
    
    cout << sum/2 << endl;
    
  }

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

#include<bits/stdc++.h>
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using ii = pair<int, int>;

int main(){
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	vector<int> vs(n);
	for(auto &x:vs)
		cin >> x;
	ll ans = 0;
	for(int i=0; i<n; ++i)
		for(int j=i+1; j<n; ++j) ans += ll(vs[i])ll(*vs[j]);
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:58: error: expected ';' before 'll'
   19 |                 for(int j=i+1; j<n; ++j) ans += ll(vs[i])ll(*vs[j]);
      |                                                          ^~
      |                                                          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>wtf(N);
for(int i=0; i<N; i++){
cin>>wtf.at(i);
}
int count=0;
for(int i=0; i<N; i++){
for(int j=0; j<i; j;;){
count+=wtf.at(i)*wtf.at(j); 
}
}
cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ')' before ';' token
   12 | for(int j=0; j<i; j;;){
      |    ~               ^
      |                    )
a.cc:12:22: error: expected primary-expression before ')' token
   12 | for(int j=0; j<i; j;;){
      |                      ^
Language: C

#include<stdio.h>
int main(void){
  	int a;
  	int b;
  int ans = 0;
  scanf("%d",&a);
  for(int k = 0; k <= a; k++){
		scanf("%d",&b[k]);
  }
  for(int i = 0; i < a; i++){
    	for(int j = i + 1; j < a; j++){
          	ans  += b[i] * b[j];
        }
  }
  printf("%d",ans);
  return 0;
}
  


Compiler output:
main.c: In function 'main':
main.c:8:30: error: subscripted value is neither array nor pointer nor vector
    8 |                 scanf("%d",&b[k]);
      |                              ^
main.c:12:26: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                          ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                                 ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:8:30: error: subscripted value is neither array nor pointer nor vector
    8 |                 scanf("%d",&b[k]);
      |                              ^
main.c:12:26: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                          ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                                 ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:8:30: error: subscripted value is neither array nor pointer nor vector
    8 |                 scanf("%d",&b[k]);
      |                              ^
main.c:12:26: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                          ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                                 ^
Language: C

#include<stdio.h>
int main(void){
  	int a;
  	int b;
  int ans;
  scanf("%d",&a);
  for(int k = 1; k <= a; k++){
		scanf("%d",&b);
  }
  for(int i = 0; i < a; i++){
    	for(int j = 0; j < a; j++){
          	ans  += b[i] * b[j];
        }
  }
  printf("%d",ans);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:12:26: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                          ^
main.c:12:33: error: subscripted value is neither array nor pointer nor vector
   12 |                 ans  += b[i] * b[j];
      |                                 ^
Language: C++

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

int main(){
  int n,s=0;
  cin>>n;
  vector<int>d(n);
  for(int i=0;i<n;i++){
    cin>>d[i];
  }
  for(int j=i+1;j<n;j++){
    cin>>d[j];
  }
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      s+=d[i]*d[j];
    }
  }
  cout<<s<<endl;
}

  

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

    #include <bits/stdc++.h>
    using namespace std;
    int main(){
      int N;
      cin >> N;
      int d[N];
      for( int i=0;i<N;i++){
        cin >> d[i];
      }
      
      int c=0;
      for( int i=0;i<N;i++){
        for( int j=i+1;j<N;j++){
          c+=d[i]*d[j];
        }
      }

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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected unqualified-id before ';' token
    4 |           int N,;
      |                 ^
a.cc:7:15: error: 'i' was not declared in this scope
    7 |           for(i=0;i<N;i++){
      |               ^
a.cc:12:15: error: 'i' was not declared in this scope
   12 |           for(i=0;i<N;i++){
      |               ^
a.cc:13:17: error: 'j' was not declared in this scope
   13 |             for(j=i+1;j<N;j++){
      |                 ^
a.cc: At global scope:
a.cc:23:9: error: redefinition of 'int main()'
   23 |     int main(){
      |         ^~~~
a.cc:3:13: note: 'int main()' previously defined here
    3 |         int main(){
      |             ^~~~
a.cc: In function 'int main()':
a.cc:24:13: error: expected unqualified-id before ';' token
   24 |       int N,;
      |             ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: expected unqualified-id before ';' token
    4 |       int N,;
      |             ^
a.cc:7:11: error: 'i' was not declared in this scope
    7 |       for(i=0;i<N;i++){
      |           ^
a.cc:12:11: error: 'i' was not declared in this scope
   12 |       for(i=0;i<N;i++){
      |           ^
a.cc:13:13: error: 'j' was not declared in this scope
   13 |         for(j=i+1;j<N;j++){
      |             ^
Language: C++

#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main(void){
  int num,sum,square,ans,N;
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> num;
    sum = sum + num;
    square = square + num * num;
    num = 0;
    if(i = N - 1){
      cout << ( sum * sum - square ) / 2;
  }   
}

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

#include<iostream>
#include<vector>
using namespace std;
using ll=long long;

int main(){
  ll N;
  cin>>N;
  vector<int> d(N);
  ll ans=0;
  for(int i=0;i<n;i++){
      cin>>d[i];
    }
  for(int i=0;i<n-1;i++){
     for(int 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:11:17: error: 'n' was not declared in this scope
   11 |   for(int i=0;i<n;i++){
      |                 ^
a.cc:14:17: error: 'n' was not declared in this scope
   14 |   for(int i=0;i<n-1;i++){
      |                 ^
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 sum = 0;
  int sum2 = 0;
  for (int i = 0; i < n; i++) {
    sum += d.at(i);
    sum2 += d.at(i) * d.at(i);
  }
  cout << (sum * sum - sum2) / 2; << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: expected primary-expression before '<<' token
   17 |   cout << (sum * sum - sum2) / 2; << endl;
      |                                   ^~
Language: C

#include<stdio.h>

int main(void)
{
  int n,d[60],ans=0,i;
  scanf("%d",&n);
  for(i=0;n>i;i++)
    scanf("%d",&d[i]);
  for(i=0;n>i;i++)
    for(j=i+1;j>n;j++)
      ans += d[i]*d[j];
  printf("%d\n",ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'j' undeclared (first use in this function)
   10 |     for(j=i+1;j>n;j++)
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,n) cin >> d.at(i);
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i,n) cin >> d.at(i);
      |   ^~~
Language: C++

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

int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  	int n;cin>>n;
  	int sum=0;
  	int a[n];
  	for(int i=0;i<n;i++){
      cin>>a[i];
      sum+=a[i];
    }
  	int res=0;
  	fr(i,0,n-1){
      sum=sum-a[i];
      res+=(sum*a[i]);
    }
  	cout<<res<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'i' was not declared in this scope
   14 |         fr(i,0,n-1){
      |            ^
a.cc:14:9: error: 'fr' was not declared in this scope
   14 |         fr(i,0,n-1){
      |         ^~
Language: C++

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


int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i,n) cin >> d[i];
  int s = 0;
  rep(i,n-1) s += d[i]*d[i+1]
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: expected ';' before 'cout'
   13 |   rep(i,n-1) s += d[i]*d[i+1]
      |                              ^
      |                              ;
   14 |   cout << s << endl;
      |   ~~~~
Language: C++

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


int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i,n) cin >> d(i);
  int s = 0;
  rep(i,n-1) s += d(i)*d(i+1)
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: no match for call to '(std::vector<int>) (int&)'
   11 |   rep(i,n) cin >> d(i);
      |                   ~^~~
a.cc:13:20: error: no match for call to '(std::vector<int>) (int&)'
   13 |   rep(i,n-1) s += d(i)*d(i+1)
      |                   ~^~~
a.cc:13:25: error: no match for call to '(std::vector<int>) (int)'
   13 |   rep(i,n-1) s += d(i)*d(i+1)
      |                        ~^~~~~
Language: C++

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


int main() {
  int n;
  cin >> n;
  vectoe<int> d(n);
  rep(i,n) cin >> d(i);
  int s = 0;
  rep(i,n-1) s += d(i)*d(i+1)
  cout << s << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vectoe' was not declared in this scope
   10 |   vectoe<int> d(n);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vectoe<int> d(n);
      |          ^~~
a.cc:11:19: error: 'd' was not declared in this scope
   11 |   rep(i,n) cin >> d(i);
      |                   ^
a.cc:13:19: error: 'd' was not declared in this scope
   13 |   rep(i,n-1) s += d(i)*d(i+1)
      |                   ^
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++)  in>>v[i];}
int sum=0;
for(int i=0;i<n;i++)
  	for(int j=i+1;j<n;j++)
      sum+=v[i][j];
cout<<sum;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'in' was not declared in this scope; did you mean 'i'?
    6 | for(int i=0;i<n;i++)  in>>v[i];}
      |                       ^~
      |                       i
a.cc: At global scope:
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<n;i++)
      | ^~~
a.cc:8:13: error: 'i' does not name a type
    8 | for(int i=0;i<n;i++)
      |             ^
a.cc:8:17: error: 'i' does not name a type
    8 | for(int i=0;i<n;i++)
      |                 ^
a.cc:9:23: error: 'j' does not name a type
    9 |         for(int j=i+1;j<n;j++)
      |                       ^
a.cc:9:27: error: 'j' does not name a type
    9 |         for(int j=i+1;j<n;j++)
      |                           ^
a.cc:11:1: error: 'cout' does not name a type
   11 | cout<<sum;
      | ^~~~
Language: C

#include<stdio.h>
int main()
{
int a,i,j;
long int b;
  scanf("%d",&a);
  b=0;
int c[a];
for(i=0;i<a;++i)
   {scanf("%d",&c[i]);
   }
for(i=1;i<a;++i)  
   {
    for(j=0;j<i;++j)
    {b=b+c[i]*c[j];}
   }
  printf("%ld",b)
  
  
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:18: error: expected ';' before 'return'
   17 |   printf("%ld",b)
      |                  ^
      |                  ;
......
   20 | return 0;
      | ~~~~~~
Language: C

#include<stdio.h>
int main()
{
int a,i,j;
long int b;
  scanf("%d",&a);
  b=0;
int c[a];
for(i=0;i<a;++i)
   {scanf("%d",&c[i]);
   }
for(i=1;i<a;++i)  
   {
    for(j=0;j<i;++j)
    b=b+c[i]*c[j];
   }
  printf("%ld",b)
  
  
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:18: error: expected ';' before 'return'
   17 |   printf("%ld",b)
      |                  ^
      |                  ;
......
   20 | return 0;
      | ~~~~~~
Language: C++

#include <string>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <math.h>
 
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
 
	int x,y;
	cin >> x;
    vector<int> vec(114514);
    for(int i=0; i<x;i++){
      cin >> vec.at(i);
    }
    for(int i=0;i<x;i++){
      for(intj=0;j<x;j++){
        if(j!=i){
          sum += vec.at(i)*vec.at(j); 
        }
      }
    }
      cout << sum << "\n";
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'intj' was not declared in this scope; did you mean 'int'?
   21 |       for(intj=0;j<x;j++){
      |           ^~~~
      |           int
a.cc:21:18: error: 'j' was not declared in this scope
   21 |       for(intj=0;j<x;j++){
      |                  ^
a.cc:23:11: error: 'sum' was not declared in this scope
   23 |           sum += vec.at(i)*vec.at(j);
      |           ^~~
a.cc:27:15: error: 'sum' was not declared in this scope
   27 |       cout << sum << "\n";
      |               ^~~
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 sum=0;
  for(int i=0;i<N;i++)
    sum+=d.at(i);
  int sum1=0;
  for(int i=0;i<N;i++)
    sum1+=d.at(i).d.at(i);
  cout<<(sum*sum-sum1)/2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: request for member 'd' in 'd.std::vector<int>::at(((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |     sum1+=d.at(i).d.at(i);
      |                   ^
Language: C++

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

using namespace std;

int main(){
  int n;
  cin >> n;
  int sum = 0;
  int sqsum = 0;
  for(i=0; i<n; i++){
    int x;
    cin >> x;
    sum += x;
    sqsum += x**2;
  }
  cout << (sum**2 - sqsum) / 2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0; i<n; i++){
      |       ^
a.cc:15:16: error: invalid type argument of unary '*' (have 'int')
   15 |     sqsum += x**2;
      |                ^~
a.cc:17:16: error: invalid type argument of unary '*' (have 'int')
   17 |   cout << (sum**2 - sqsum) / 2 << endl;
      |                ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
int N;
  cin>>N;
  int d[i];
  for ( int i=0; i<N; i++) cin>>d[i];
  int sum=0;
  for (int i=0; i<N; i++) sum+=d[i];
  int cheer=0;
  for (int i=0; i<N; i++){
    cheer+=d[i]*(sum-d[i]);}
  cout<<cheer/2<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |   int d[i];
      |         ^
a.cc:7:33: error: 'd' was not declared in this scope
    7 |   for ( int i=0; i<N; i++) cin>>d[i];
      |                                 ^
a.cc:9:32: error: 'd' was not declared in this scope
    9 |   for (int i=0; i<N; i++) sum+=d[i];
      |                                ^
a.cc:12:12: error: 'd' was not declared in this scope
   12 |     cheer+=d[i]*(sum-d[i]);}
      |            ^
Language: C++

#include <iostream>
using namespace std;
 
int D[100];
 
int main()
{
	int n, r=0;
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> D[i];
	for (int i = 0; i < n; ++i)
	{
		for (int j= i + 1; j < n; ++j)
		{
			int x = D[i];
			int y = D[j];
		}
	r = r + x*y;	
	}
	cout << r;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'x' was not declared in this scope
   19 |         r = r + x*y;
      |                 ^
a.cc:19:19: error: 'y' was not declared in this scope
   19 |         r = r + x*y;
      |                   ^
Language: C++

#include <iostream>
using namespace std;
int d[50];
int main()
{
  int sum=0,n,zbroj=0;
  for(int i=0;i<n;i++)
  	cin >> d[i];
  
    for(int i=0;i<n;i++)
    {
      for(int j=i+1;j<n;j++)
      {
        int x=d[i];
        int y=d[j];
        sum=sum+(x*y);
      }
    }
    zbroj=zbroj+sum; 
  }
  cout << zbroj;
}

Compiler output:
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << zbroj;
      |   ^~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
 
int D[100];
 
int main()
{
	int n, r=0;
	cin >> n;
	for (int i = 0; i < n; ++i)
    {	
      cin >> D[i];
    } 
	for (int i = 0; i < n; ++i)
	{
		for (int j= i + i; j < n; ++j)
		{
			int x = D[i];
			int y = D[j];
		}
	r = r + x*y;	
	}
	cout << r;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'x' was not declared in this scope
   21 |         r = r + x*y;
      |                 ^
a.cc:21:19: error: 'y' was not declared in this scope
   21 |         r = r + x*y;
      |                   ^
Language: C++

#include <iostream>
using namespace std;
 
int D[100];
 
int main()
{
	int n, r=0;
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> D[i];
	for (int i = 0; i < n; ++i)
	{
		for (int j= i + i; j < n; ++j)
		{
			int x = D[i];
			int y = D[j];
		}
	r = r + x*y;	
	}
	cout << r;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'x' was not declared in this scope
   19 |         r = r + x*y;
      |                 ^
a.cc:19:19: error: 'y' was not declared in this scope
   19 |         r = r + x*y;
      |                   ^
Language: C++

#include <iostream>
using namespace std;
 
int D[100000];
 
int main()
{
	int n, r=0;
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> D[i];
	for (int i = 0; i < n; ++i)
	{
		for (int j= i + i; j < n; ++j)
		{
			int x = D[i];
			int y = D[j];
		}
	r = r + x*y;	
	}
	cout << r;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'x' was not declared in this scope
   19 |         r = r + x*y;
      |                 ^
a.cc:19:19: error: 'y' was not declared in this scope
   19 |         r = r + x*y;
      |                   ^
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 answer=0;
  for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
 
answer += d[i]*d[j]

  }
}

cout <<answer<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before '}' token
   15 | answer += d[i]*d[j]
      |                    ^
      |                    ;
   16 | 
   17 |   }
      |   ~