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

#include <bits/stdc++.h>

using namespace std;
 
//#define int long long
using ll = long long;
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,n) for(ll i=0;i<=n;i++)


ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
 
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    ios_base::sync_with_stdio(false);
    ll N,ans=0;
    cin >> N;

    rep(i,N){
        cin >> A[i];
    }

    for(int i=0;i<N;i++){
        for(int j=i+1;j<N;j++){
            ans += A[i]*A[j];
        }
    }

    cout << ans % MOD << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: 'A' was not declared in this scope
   26 |         cin >> A[i];
      |                ^
a.cc:31:20: error: 'A' was not declared in this scope
   31 |             ans += A[i]*A[j];
      |                    ^
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
	int n;
	cin>>n;
	long long int A[n];
	long long int dp[n];
	long long int base = 1000000007;
	dp[0] = A[0];
	for (int i=0; i<n; i++){
		cin>>A[i];
	}
	for (int i=1; i<n; i++){
		dp[i] = dp[i - 1] + A[i];
		dp[i] %= base;
	}
	long long int ans = 0;
	for (int i=0; i<n-1; i++){
		if(dp[n - 1] - dp[i] < 0)	ans += A[i] * (dp[n - 1] - d[i] + base);
		else	ans += A[i] * (dp[n - 1] - dp[i]);
		ans %= base;
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:76: error: 'd' was not declared in this scope
   21 |                 if(dp[n - 1] - dp[i] < 0)       ans += A[i] * (dp[n - 1] - d[i] + base);
      |                                                                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007 
int main(){
   int n;
   long long sum=0,s=0;
   long long a[200005];
   cin>>n;
   for(int i=0; i<n; i++){
       cin>>a[i];
       s+=a[i];
       s%=MOD;
   }
   for(int i=0; i<n; i++){
        s-=a[i];
        if (s < 0) s += mod;
        sum+=a[i]*s;
        sum%=MOD;
   }

   cout<<sum<<'\n';
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |         if (s < 0) s += mod;
      |                         ^~~
      |                         modf
Language: C

#include<stdio.h>
int main(void){
  long long int n;
  scanf("%lld",&n);
  long long int a[n],i,j,b=0,s=0;
  for(i=0;i<n;i++){
  	scanf("%lld",&a[i]);
	b+=a[i];
  }
  for(i=0;i<n;i++){
	b=b-a[i];
	s+=(a[i]*b)%1000000007:
  }
  printf("%lld\n",s);
  
  return 0;
  
}


Compiler output:
main.c: In function 'main':
main.c:12:31: error: expected ';' before ':' token
   12 |         s+=(a[i]*b)%1000000007:
      |                               ^
      |                               ;
Language: C++

#include <iostream>
using namespace std;
#define M 1e9 + 7
#define ll long long 
#define tc int t; cin>>t; while(t--)
	
int main(){
	int n;
	cin>>n;
	ll arr[n];
	for(int i = 0; i < n; i++){
        cin>>arr[i];
	}
	ll ans = 0 , p = 1;
	for(int i = 0 ; i < n; i++){
        for(int j =i+1; j < n; j++){
            p = ((arr[i]%M)*(arr[j]%M))%M;
            ans+=p;
        }
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   17 |             p = ((arr[i]%M)*(arr[j]%M))%M;
      |                   ~~~~~~^
      |                        |
      |                        long long int
a.cc:17:36: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   17 |             p = ((arr[i]%M)*(arr[j]%M))%M;
      |                              ~~~~~~^
      |                                   |
      |                                   long long int
Language: C++

#include <iostream>
using namespace std;
#define M 1e9 + 7
#define ll long long 
#define tc int t; cin>>t; while(t--)
	
int main(){
	int n;
	cin>>n;
	ll arr[n];
	for(int i = 0; i < n; i++){
        cin>>arr[i];
	}
	ll ans = 0 , prod = 1;
	for(int i = 0 ; i < n; i++){
        for(int j =i+1; j < n; j++){
            p = ((arr[i]%M)*(arr[j]%M))%M;
            ans+=p;
        }
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'p' was not declared in this scope
   17 |             p = ((arr[i]%M)*(arr[j]%M))%M;
      |             ^
a.cc:17:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   17 |             p = ((arr[i]%M)*(arr[j]%M))%M;
      |                   ~~~~~~^
      |                        |
      |                        long long int
a.cc:17:36: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   17 |             p = ((arr[i]%M)*(arr[j]%M))%M;
      |                              ~~~~~~^
      |                                   |
      |                                   long long int
Language: C

#include <bits/stdc++.h>

using namespace std;

#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
#define MP make_pair
#define PB push_back
#define X first
#define Y second

typedef long long int lld;
typedef pair<int, int> pii;
typedef pair<lld, lld> pll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n = 0;
    cin >> n;
    vector<lld> v(n);

    for (lld &x : v) {
        cin >> x;
    }

    lld sum = accumulate(v.begin(), v.end(), 0);
    lld ans = 0;
    lld mod = (lld) 1e9 + 7;

    for (int i = n - 1; i >= 0; i--) {
        sum -= v[i];
        lld t = (sum % mod) * v[i];
        ans = (ans + t) % mod;
    }

    cout << ans % mod << '\n';

    return 0;
}

// g++ sol.cpp -o sol.out -Wall -Wextra -Wshadow -fsanitize=undefined -std=c++17

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

 int N;
  cin  >> N;
  vector<long long> vec(N);
  long long sum=0;
  long long x=0;
  long long  y=0;
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }
  for(int i=0; i<N-1; i++){
    for(int k=i+1; k<N; k++){
    x=vec.at(i)*vec.at(k);
      y=x%(1000000000+7);
      sum=sum+y;
        x=0;
      y=0;
    }
  }
  cout << sum << endl;
 }
        


Compiler output:
a.cc:2:3: error: 'cin' does not name a type
    2 |   cin  >> N;
      |   ^~~
a.cc:3:3: error: 'vector' does not name a type
    3 |   vector<long long> vec(N);
      |   ^~~~~~
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(int i=0; i<N; i++){
      |   ^~~
a.cc:7:16: error: 'i' does not name a type
    7 |   for(int i=0; i<N; i++){
      |                ^
a.cc:7:21: error: 'i' does not name a type
    7 |   for(int i=0; i<N; i++){
      |                     ^
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for(int i=0; i<N-1; i++){
      |   ^~~
a.cc:10:16: error: 'i' does not name a type
   10 |   for(int i=0; i<N-1; i++){
      |                ^
a.cc:10:23: error: 'i' does not name a type
   10 |   for(int i=0; i<N-1; i++){
      |                       ^
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout << sum << endl;
      |   ^~~~
a.cc:20:2: error: expected declaration before '}' token
   20 |  }
      |  ^
Language: C++

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

int main(){
  int n,x;
  x = 0;
  cin >> n;
  vector<int> a(n);
  
  for(int i=0;i<n;i++)
    cin >> a(i);
  for(int i=1;i<n;i++){
    for(int j=i+1;j<n+1;j++)
      x += a(i)*a(j);
  }
  x = x % (7+10^9);
  cout << x << endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >> a(i);
      |            ~^~~
a.cc:14:13: error: no match for call to '(std::vector<int>) (int&)'
   14 |       x += a(i)*a(j);
      |            ~^~~
a.cc:14:18: error: no match for call to '(std::vector<int>) (int&)'
   14 |       x += a(i)*a(j);
      |                 ~^~~
Language: C++

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

int main(){
  int n,x;
  x = 0;
  cin >> n;
  vector<int> a(n);
  
  for(int i=0;i<n;i++)
    cin >> a(i);
  for(int i=1;i<n;i++){
    for(int j=i+1;j<n+1;j++)
      x += a(i)*a(j);
  }
  x = x % (10^9+7);
  cout << x << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >> a(i);
      |            ~^~~
a.cc:14:13: error: no match for call to '(std::vector<int>) (int&)'
   14 |       x += a(i)*a(j);
      |            ~^~~
a.cc:14:18: error: no match for call to '(std::vector<int>) (int&)'
   14 |       x += a(i)*a(j);
      |                 ~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    ll sum = 0;
    int mod = 1000000009;
    ll sum = 0;
    for(int i = 0; i < n; i++){
        cin >> A[i];
        sum += A[i];
        sum %= mod;
    }
    
    
    long ans = 0;
    for(int i = 0; i < n; i++){
        sum -= A[i];
        if(sum < 0){
            sum += mod;
        }
        ans += A[i]*sum;
        ans %= mod;
    }
    
    cout << ans << endl;
    
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    ll sum = 0;
    int mod = 1000000009;
    ll sum = 0;
    for(int i = 0; i < n; i++){
        cin >> A[i];
        ssum += A[i];
        sum %= mod;
    }
    
    
    long ans = 0;
    for(int i = 0; i < n; i++){
        sum -= A[i];
        if(sum < 0){
            sum += mod;
        }
        ans += A[i]*sum;
        ans %= mod;
    }
    
    cout << ans << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: redeclaration of 'long long int sum'
   10 |     ll sum = 0;
      |        ^~~
a.cc:8:8: note: 'long long int sum' previously declared here
    8 |     ll sum = 0;
      |        ^~~
a.cc:13:9: error: 'ssum' was not declared in this scope; did you mean 'sum'?
   13 |         ssum += A[i];
      |         ^~~~
      |         sum
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1e9
int main(){
    ll n;
    cin >> n;
    ll arr[n];
    for(ll i = 0; i < n; i++){
        cin >> arr[i];
    }
        
    ll sum = 0;
    for(ll i = 0 ; i < n; i++){
        sum = (sum + arr[i])%mod;
    }
    
    ll subthis = 0;
    ll currsum = sum;
    ll ans = 0;
    for(ll i = 0; i < n; i++){
        currsum = currsum - arr[i];
        ans = (ans + (arr[i]*currsum)%mod)%mod;
    }
    
    cout << ans << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   15 |         sum = (sum + arr[i])%mod;
      |               ~~~~~~~~~~~~~~^
      |                    |
      |                    long long int
a.cc:23:38: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   23 |         ans = (ans + (arr[i]*currsum)%mod)%mod;
      |                      ~~~~~~~~~~~~~~~~^
      |                             |
      |                             long long int
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
typedef unsigned long long ui;

int main(){

  int n;
  ui sum=0;
  cin >> n;
  ui 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 += a[i]*a[j];
      sum %= (pow(10,9.0) + 7);
    }
  }
  cout << sum;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: invalid operands of types 'ui' {aka 'long long unsigned int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   18 |       sum %= (pow(10,9.0) + 7);
      |       ~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:18:11: note:   in evaluation of 'operator%=(ui {aka long long unsigned int}, __gnu_cxx::__promote<double>::__type {aka double})'
Language: C++

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

typedef int64_ l;
const l mod=10e9+7;

int main(){
	l n;
	cin >> n;
	l a[n], s=0;
	for(l i=0; i<n; i++) cin >> a[i];
	
	for(l i=0; i<n; i++){
		for(l j=i+1; j<n; j++){
			s += (a[i]*a[j])%mod;
			s %= mod;
		}
	}
	cout << s;
	return 0;
}

Compiler output:
a.cc:4:9: error: 'int64_' does not name a type; did you mean 'int64_t'?
    4 | typedef int64_ l;
      |         ^~~~~~
      |         int64_t
a.cc:5:7: error: 'l' does not name a type
    5 | const l mod=10e9+7;
      |       ^
a.cc: In function 'int main()':
a.cc:8:9: error: 'l' was not declared in this scope
    8 |         l n;
      |         ^
a.cc:9:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |         cin >> n;
      |                ^
      |                yn
a.cc:10:10: error: expected ';' before 'a'
   10 |         l a[n], s=0;
      |          ^~
      |          ;
a.cc:11:14: error: expected ';' before 'i'
   11 |         for(l i=0; i<n; i++) cin >> a[i];
      |              ^~
      |              ;
a.cc:11:20: error: 'i' was not declared in this scope
   11 |         for(l i=0; i<n; i++) cin >> a[i];
      |                    ^
a.cc:11:37: error: 'a' was not declared in this scope
   11 |         for(l i=0; i<n; i++) cin >> a[i];
      |                                     ^
a.cc:13:14: error: expected ';' before 'i'
   13 |         for(l i=0; i<n; i++){
      |              ^~
      |              ;
a.cc:13:20: error: 'i' was not declared in this scope
   13 |         for(l i=0; i<n; i++){
      |                    ^
a.cc:14:22: error: expected ';' before 'j'
   14 |                 for(l j=i+1; j<n; j++){
      |                      ^~
      |                      ;
a.cc:14:30: error: 'j' was not declared in this scope; did you mean 'jn'?
   14 |                 for(l j=i+1; j<n; j++){
      |                              ^
      |                              jn
a.cc:15:25: error: 's' was not declared in this scope
   15 |                         s += (a[i]*a[j])%mod;
      |                         ^
a.cc:15:31: error: 'a' was not declared in this scope
   15 |                         s += (a[i]*a[j])%mod;
      |                               ^
a.cc:15:42: error: 'mod' was not declared in this scope; did you mean 'modf'?
   15 |                         s += (a[i]*a[j])%mod;
      |                                          ^~~
      |                                          modf
a.cc:19:17: error: 's' was not declared in this scope
   19 |         cout << s;
      |                 ^
Language: C++

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


int main(){
  int N;
  cin>>N;
  vector<uint64_t> a(N);
  for(int i=0;i<N;i++){
    cin>>a.at(i);
  }
  uint64_t sum;
  uint64_t suma=0;
  uint64_t sums=0;
  for(int i=0;i<N;i++){
    suma+=a.at(i);
    suma=suma%1000000007;
  }
  sum=suma*suma;
  for(int i=0;i<N;i++){
    sums+=a.at(i)*a.at(i);
    sums=sums%1000000007;
  }
  sum=(suma-sums)/2;
  sum=abs(sum)%1000000007;
  cout<<sum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: call of overloaded 'abs(uint64_t&)' is ambiguous
   25 |   sum=abs(sum)%1000000007;
      |       ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

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

#define rep(i,j,n) for(int i=j;i<n;i++)

int main(){
  int N;
  cin>>N;
  vector<int> a(N);
  rep(i,0,N){
    cin>>a.at(i);
  }
  int sum=0;
  rep(i,0,N){
    rep(j,i+1,N){
      sum+=a.at(i)*a.at(j);
      sum=sum%(pow(10,9)+7);
    }
  }
  cout<<sum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   17 |       sum=sum%(pow(10,9)+7);
      |           ~~~^~~~~~~~~~~~~~
      |           |             |
      |           int           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
 long long int n;
  cin>>n;
  long long int a[n+1];
  long long int mod=1000000007;
long long int sum=0;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
   sum+=a[i];
}
  long long int r=0;
  for(int i=0;i<n-1;i++)
  {
    sum-=a[i];
   r+=((a[i]%mod)*(sum%mod))%mod;
    r%=mod;
  }

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

#include<iostream>
using namespace std;
 
int main()
{
 long long int n;
  cin>>n;
  long long int a[n+1];
  long long int mod=1000000007;
long long int sum=0;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
   sum+=a[i];
}
  long long int r=0;
  for(int i=0;i<n-1;i++)
  {
    sum-=a[i];
   r+=a[i]*(sum%mod);
    r%=mood;
  }
cout<r<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: 'mood' was not declared in this scope; did you mean 'mod'?
   21 |     r%=mood;
      |        ^~~~
      |        mod
a.cc:23:7: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   23 | cout<r<<endl;
      |      ~^~~~~~
Language: C++

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

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

int main(){
  int N;
  cin>>N;
  vector<int> a(N);
  uint64_t sum=0LL;
  rep(i,N){
    rep(j,N){
      sum+=a.at(i)*a.at(j);
      sum=sum%(pow(10,9)+7);
    }
  }
  cout<<sum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: invalid operands of types 'uint64_t' {aka 'long unsigned int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   14 |       sum=sum%(pow(10,9)+7);
      |           ~~~^~~~~~~~~~~~~~
      |           |             |
      |           |             __gnu_cxx::__promote<double>::__type {aka double}
      |           uint64_t {aka long unsigned int}
Language: C++

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

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

int main(){
  int N;
  cin>>N;
  vector<int> a(N);
  uint64_t sum=0LL;
  rep(i,N){
    rep(j,N){
      sum+=a.at(i)*a.at(j);
      sum=sum%(pow(10,9)+7);
    }
  }
  cout<<sum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected primary-expression before '=' token
    4 | #define rep(i,n)=for(int i=0;i<n;i++)
      |                 ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,N){
      |   ^~~
a.cc:4:18: error: expected primary-expression before 'for'
    4 | #define rep(i,n)=for(int i=0;i<n;i++)
      |                  ^~~
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,N){
      |   ^~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   rep(i,N){
      |       ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n)=for(int i=0;i<n;i++)
      |                              ^
Language: C++

#include <iostream> 
using namespace std; 

void findProductSum(int A[], int n) 
{ 
	int product = 0; 
	for (int i = 0; i < n; i++) 
		for (int j = i+1; j < n; j++) 
			product = product + A[i]*A[j]; 
	cout<< product; 
} 
 
int main() 
{ 	int n, A[];
 	cin>>n;
 	for(int i=0;i<n;i++){
   		cin>>A[i];}
	findProductSum(A, n); 

	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: storage size of 'A' isn't known
   14 | {       int n, A[];
      |                ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define mod 1e9+7
using namespace std;
int main()
{
  ll n;cin>>n;ll a[n];ll ans;
  for(ll i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n;i++)
  {
    for(int j=i+1;j<n;j++)
      ans=(a[i]*a[j])%mod;
  }
  cout<<ans<<"\n";
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   13 |       ans=(a[i]*a[j])%mod;
      |           ~~~~~~~~~~~^
      |                |
      |                long long int
Language: C++

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

int main(){
  int N;
  vector<int> A(N);
  int mod = 1000000007;
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> A[i];
  }
  vector<long long> S(N+1,0);
  for(int i=0; i<N; i++){
    S[i+1] = S[i] + A[i];
  }
  long long sum = 0;
  for(int i=0; i<N; i++){
    sum = (sum + (((S[N]-S[i+1]) % mod*A[i]) % mod)%mod;
  }
  cout << sum % mod << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:56: error: expected ')' before ';' token
   19 |     sum = (sum + (((S[N]-S[i+1]) % mod*A[i]) % mod)%mod;
      |           ~                                            ^
      |                                                        )
Language: C++

#include<iostream>
#include<vector>
using namespace std;
// modは一気にやってはいけない。だんだんです。
// なので一個ずつやります。

int main(){
    int n;
    long long int sum = 0;
    int mod = 1000000007;
    cin >> n;
    vector<int>num(n);
    for(int i = 0; i < n; i++){
        cin >> num[i];
        sum += num[i];

        // 足し算する前に各項をmodしとく
        sum %= mod;
    }

    long ans = 0;

    for(int i = 0; i < n; i++){
        sum -= num[i]; //減らしていく
        if(sum < 0) sum += mod;
        ans += a[i]*sum;
        ans %= mod;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: 'a' was not declared in this scope
   26 |         ans += a[i]*sum;
      |                ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
// modは一気にやってはいけない。だんだんです。
// なので一個ずつやります。

int main(){
    int n;
    long long int sum = 0;
    long long int ans = 0;
    int mod = 1000000007;
    cin >> n;
    vector<int>num(n);
    for(int i = 0; i < n; i++){
        cin >> num[i];
        sum += num[i];

        // 足し算する前に各項をmodしとく
        sum %= mod;
    }

    long ans = 0;

    for(int i = 0; i < n; i++){
        sum -= num[i]; //減らしていく
        if(sum < 0) sum += mod;
        
        ans %= mod;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: conflicting declaration 'long int ans'
   22 |     long ans = 0;
      |          ^~~
a.cc:10:19: note: previous declaration as 'long long int ans'
   10 |     long long int ans = 0;
      |                   ^~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  	int N;
  	long long sum, sq;
  	cin >> N;
  	for(int i=0;i<N;i++){
      	long long tmp;
      	cin >> tmp;
      	sum+=tmp;
      	sq+=tmp*tmp;
    }
  	long long big=1e9+7;
  	cout << ((sum*sum-sq)/2)%(big)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:39: error: expected ';' before '}' token
   16 |         cout << ((sum*sum-sq)/2)%(big)
      |                                       ^
      |                                       ;
   17 | }
      | ~
Language: C++

#include <iostream>

using namespace std;

int main(){
  	int N;
  	long long sum, sq;
  	cin >> N;
  	for(int i=0;i<N;i++){
      	long long tmp;
      	cin >> tmp;
      	sum+=tmp;
      	sq+=tmp*tmp;
    }
  	cout << ((sum*sum-sq)/2)%(long long(1e9+7))
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: expected primary-expression before 'long'
   15 |         cout << ((sum*sum-sq)/2)%(long long(1e9+7))
      |                                   ^~~~
a.cc:15:35: error: expected ')' before 'long'
   15 |         cout << ((sum*sum-sq)/2)%(long long(1e9+7))
      |                                  ~^~~~
      |                                   )
Language: C++

#include <iostream>

using namespace std;

int main(){
  	int N;
  	long long sum, sq;
  	cin >> N;
  	for(int i=0;i<N;i++){
      	long long tmp;
      	cin >> tmp;
      	sum+=tmp;
      	sq+=tmp*tmp;
    }
  	cout << ((sum*sum-sq)/2)%(1e9+7)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   15 |         cout << ((sum*sum-sq)/2)%(1e9+7)
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~
      |                              |       |
      |                              |       double
      |                              long long int
Language: C++

int main() {
	unsigned int N;
	vector<unsigned int> Ai;
	cin >> N;
	Ai.resize(N);
	for (unsigned int i = 0; i < N; i++) {
	    cin >> Ai[i];
	}

    unsigned long long int answer = 0;
    unsigned long long int mulans = 0;
    unsigned long long int mulbase = 0;

	for (unsigned int i = 0; i < N - 1; i++) {
		mulbase += Ai[N-1-i];
	    mulans = mulbase * Ai[N-2-i];
	    answer = (answer + mulans) % 1000000007;
	}

    cout << answer << endl;
	// cout << tlen - max << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'vector' was not declared in this scope
    3 |         vector<unsigned int> Ai;
      |         ^~~~~~
a.cc:3:16: error: expected primary-expression before 'unsigned'
    3 |         vector<unsigned int> Ai;
      |                ^~~~~~~~
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N;
      |         ^~~
a.cc:5:9: error: 'Ai' was not declared in this scope
    5 |         Ai.resize(N);
      |         ^~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << answer << endl;
      |     ^~~~
a.cc:20:23: error: 'endl' was not declared in this scope
   20 |     cout << answer << endl;
      |                       ^~~~
Language: C++

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>
using namespace std;
using ll = long long;
constexpr ll INF = 1010000000000000017LL;
constexpr ll mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()

int main() {
    int n;cin>>n;
    ll a[n];
    rep(i,n) cin>>a[i];
    ll sum = 0;
    for(int i = 0; i < n; ++i) sum += a[i];
    // cout<<sum<<endl;

    ll res = 0;
    rep(i,n) {
        sum -= a[i];
        res += sum * a[i];
        res %= mod;
    }
    out<<res<<endl;
}#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>
using namespace std;
using ll = long long;
constexpr ll INF = 1010000000000000017LL;
constexpr ll mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()

int main() {
    int n;cin>>n;
    ll a[n];
    rep(i,n) cin>>a[i];
    ll sum = 0;
    for(int i = 0; i < n; ++i) sum += a[i];
    // cout<<sum<<endl;

    ll res = 0;
    rep(i,n) {
        sum -= a[i];
        res += sum * a[i];
        res %= mod;
    }
    out<<res<<endl;
}

Compiler output:
a.cc:33:2: error: stray '#' in program
   33 | }#include <fstream>
      |  ^
a.cc: In function 'int main()':
a.cc:32:5: error: 'out' was not declared in this scope
   32 |     out<<res<<endl;
      |     ^~~
a.cc: At global scope:
a.cc:33:3: error: 'include' does not name a type
   33 | }#include <fstream>
      |   ^~~~~~~
a.cc:45:14: error: redefinition of 'constexpr const ll INF'
   45 | constexpr ll INF = 1010000000000000017LL;
      |              ^~~
a.cc:13:14: note: 'constexpr const ll INF' previously defined here
   13 | constexpr ll INF = 1010000000000000017LL;
      |              ^~~
a.cc:46:14: error: redefinition of 'constexpr const ll mod'
   46 | constexpr ll mod = 1000000007;
      |              ^~~
a.cc:14:14: note: 'constexpr const ll mod' previously defined here
   14 | constexpr ll mod = 1000000007;
      |              ^~~
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main() {
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:64:5: error: 'out' was not declared in this scope
   64 |     out<<res<<endl;
      |     ^~~
Language: C++

//ABC 177 C
#include <bits/stdc++.h>
#define MOD 1e9+7    //1000000007
using namespace std;

int main(){
	int n, x, total=0;
	cin >> n;
	int a[n+1];
	long long s[n+1];
	
	s[0] = 0;
	for (int i=1; i<=n; i++){
		cin >> a[i];
		s[i] = s[i-1] + a[i];
	}
	
	for (i=1; i<n; i++){
		total += a[i] * (s[n]-s[i]) % MOD; 
	}
	
	cout << total % MOD;
	return 0; 
} 



Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: 'i' was not declared in this scope
   18 |         for (i=1; i<n; i++){
      |              ^
a.cc:22:23: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   22 |         cout << total % MOD;
      |                 ~~~~~ ^
      |                 |
      |                 int
Language: C++

#include "pch.h"
#include<iostream>

using namespace std;

int main() 
{
	int N;
	int ans = 0;
	int a[10000];

	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++)
		{
			int t = a[i] * a[j];
			ans += t;
			//cout << j << "pp" << a[j] << "aa" << a[i] << "_" << t << "\n";
		}
		//cout << a[i] << "_" << i << "\n";
	}
	cout << ans;

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#define MOD 1e9+7
using namespace std;

int main()
{
	int n,i,x;
    cin>>n;
    int a[n+1];
	long long s[n+1],total=0;
    
    s[0]=0;
    
    for(i=1;i<=n;i++)
    {
    	cin>>a[i];
    	s[i]=s[i-1]+a[i];
	}
    
    for(i=1;i<n;i++)
    {
    	total+=a[i]*(s[n]-s[i])%MOD;
	}
	
	cout<<total%MOD;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   22 |         total+=a[i]*(s[n]-s[i])%MOD;
      |                ~~~~~~~~~~~~~~~~^
      |                    |
      |                    long long int
a.cc:25:20: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   25 |         cout<<total%MOD;
      |               ~~~~~^
      |               |
      |               long long int
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  int N;
  int mod = 1000000007;
  cin >> N;
  vector<int> A(N);
  long long sum =0;
  
  for(int i=0; i<N; i++){
    cin >>A[i];
    sum += A[i];
    sum %= mod;
  }
  
  long ans = 0;
  
  for(int i=0; i < N; i++){
    sum -= A[i];
    ans += A[i] * sum;
    ans %= mod;
  }
  

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

#include <stdio.h>
#include<string.h>

int main(void) {
    int N;
    scanf("%d",&N);
    for(int i=1;i<=N;i++){
        int A[i];
        scanf("%d",&A[i]);
    }
    int sub;
    
    for(int p=N;p>=1;p--){
        for(int j=1;j<p;j++){
    sub += A[p]*A[j]
        }
    }
    printf("%d",(sub)%((10^9)+7));
    
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:12: error: 'A' undeclared (first use in this function)
   15 |     sub += A[p]*A[j]
      |            ^
main.c:15:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:21: error: expected ';' before '}' token
   15 |     sub += A[p]*A[j]
      |                     ^
      |                     ;
   16 |         }
      |         ~            
main.c:18:27: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   18 |     printf("%d",(sub)%((10^9)+7));
      |                           ^
      |                         ---
      |                         1e
main.c:18:25: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   18 |     printf("%d",(sub)%((10^9)+7));
      |                         ^~
      |                         0xa
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	long long  arr[n];
	for(int i=0;i<n;i++){
		cin >> arr[i];
	}
	long long sumarr[n];
	sumarr[0] = 0;
	for(int i=1;i<n;i++){
		sumarr[i] += sumarr[i-1];
	}
	long long sum = 0;
	for(int i=0;i<n;i++){
		sum = sum%1e9+7 + arr[i]*(sumarr[n-1] - sum[arr[i]])%1e9+7;
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   19 |                 sum = sum%1e9+7 + arr[i]*(sumarr[n-1] - sum[arr[i]])%1e9+7;
      |                       ~~~^~~~
      |                       |   |
      |                       |   double
      |                       long long int
a.cc:19:60: error: invalid types 'long long int[long long int]' for array subscript
   19 |                 sum = sum%1e9+7 + arr[i]*(sumarr[n-1] - sum[arr[i]])%1e9+7;
      |                                                            ^
Language: C

#include<stdio.h>

int main(void){
  long long int N;
  scanf("%ld",&N);
  long long int A[N];
  int i,j;
  long long int S[N+1];
  for(i=0;i<N+1;i++){
    S[i]=0;
  }
  for(i=0;i<N;i++){
    scanf("%ld",&A[i]);
    S[i+1]=(S[i]+A[i])%mod;
  }
  long long int sum=0;
  long int mod=1000000007;
  for(i=0;i<N-1;i++){
    sum+=A[i]*(S[N]-S[i+1]);
  }
  
  
  printf("%ld",sum%mod);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:24: error: 'mod' undeclared (first use in this function)
   14 |     S[i+1]=(S[i]+A[i])%mod;
      |                        ^~~
main.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
#define Vsort(a) sort(a.begin(), a.end())
#define rep(i,a,b) for(int i = a; i < (b); i++)
#define P pair<int, int>
using namespace std;

const ll mod = 1000000007;

int main() { 
  int64_t n, sum = 0, ans = 0, b;
  cin >> n;
  vector<int64_t> a(n);
  rep(i,0,n){
    cin >> a[i];
    sum += a[i];
  }
  rep(i,0,n-1){
    sum -= a[i];
    b = sum % mod;
    ans += a[i] * b;
    ans %= mod;
  }
  cout << ans << endl;
}


Compiler output:
a.cc:7:7: error: 'll' does not name a type
    7 | const ll mod = 1000000007;
      |       ^~
a.cc: In function 'int main()':
a.cc:19:15: error: 'mod' was not declared in this scope; did you mean 'modf'?
   19 |     b = sum % mod;
      |               ^~~
      |               modf
Language: C++

#include <iostream>
#include <vector>

using namespace std;
int main(){
    const long MOD=pow(10,9)+7;
    long array_amount=0;
    vector<long> array={};
    int a;
    cin>>a;
    for(int i=0;i<a;i++){
        int s;
        cin>>s;
        array.emplace_back(s);
    }
    int array_size=(int)array.size();
    
    for (int i=0;i<array_size;i++){
        for (int j=i;j<array_size;j++){
            array_amount+=array[i]+array[j];
        }
    }
    cout<<array_amount%MOD;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: 'pow' was not declared in this scope
    6 |     const long MOD=pow(10,9)+7;
      |                    ^~~
Language: C

#include <stdio.h>

int main(void){
    
    int N = 0, i, j, k = 0;
    double s = 0, ans = 0;
    double A[200000] = {};

    printf("Nの値を入力:");
    scanf("%d", &N);

    printf("A₁~ANを入力:");
    for(i = 0; i < N; i++){
        scanf("%f", &A[i]);
    }

    for(j = 0; j < N; j++){
        for(k = N-1-j; k > 1; k--){
            s = s + A[j] * A[j+1];
        }
    }

    ans = (double) s % 1000000007;
    printf("%f", ans);
}

Compiler output:
main.c: In function 'main':
main.c:23:22: error: invalid operands to binary % (have 'double' and 'int')
   23 |     ans = (double) s % 1000000007;
      |           ~~~~~~~~~~ ^
      |           |
      |           double
Language: C++

#include<iostream>
using namespace std;
const int M=1e9+7;
int main(){
   int n;
  cin>>n;
  int sum=0;
	vector<int> v(n);
  	for(int i=0;i<n;i++) cin>>v[i];
  	
  	int ans=0;
  	for(int i=n-1;i>=0;i--) {
  		ans=(ans*sum)%M;
        sum+=v[i];
      	sum%=M;
    }
    cout<<ans<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> v(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:16: error: expected primary-expression before 'int'
    8 |         vector<int> v(n);
      |                ^~~
a.cc:9:35: error: 'v' was not declared in this scope
    9 |         for(int i=0;i<n;i++) cin>>v[i];
      |                                   ^
a.cc:14:14: error: 'v' was not declared in this scope
   14 |         sum+=v[i];
      |              ^
Language: C++

/*Author:Copyrights: S7a2a7d 
 Hardwork can always beat talent */

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

#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define pb push_back
#define ll long long
#define rep(i,n)  for(ll i=0;i<n;i++)
#define repi(i,n)  for(ll i=1;i<=n;i++)
#define mem(arr,x) memset(arr,x,sizeof(arr))
     
#define mp make_pair
#define ff first
#define ss second
     
 const double PI = 3.1415926535897932;
 const int mod = 1e9 + 7;  
 const int inf = 1e9 + 5;
ll lcm(ll a,ll b)
{
        return (a*b)/__gcd(a,b);
}
int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
int max(int a,int b)
{
        if(a<b)
        return b;
        return a;
}

int main()
{
    fast_io;
    int T=1;
    //cin>>T;
    while(T--)
    {    
       ll n;
       cin>>n;
       int a[n];
       rep(i,n)
       cin>>a[i];
       vector<int>sums(n+1,0);
       for(int i=0;i<n;i++)
       {
          sums[i+1]=sums[i]+a[i];
          sums[i+1]=sums[i+1]%mod;
       }
       ll ans=0;
       for(int i=0;i<n;i++)
       {
          ll req=(sums[n]-sums[i+1])%mod;
          ans=(ans+(ll)(req*a[i])%mod;
          ans=ans%mod;
       }
        cout<<ans<<'\n';
    }
            
   
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:61:38: error: expected ')' before ';' token
   61 |           ans=(ans+(ll)(req*a[i])%mod;
      |               ~                      ^
      |                                      )
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
  ll n;	cin>>n;
  ll a[n];
  ll sum = 0;
  for(ll i=0;i<n;i++){
    cin>>a[i];
  }
  for(ll i=0;i<n;i++){
    for(ll j=i+1;j<n;j++){
      sum+=(a[i]*a[j]);
      sum = (sum%(1e9+7));	
    }
  }
  cout<<sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   14 |       sum = (sum%(1e9+7));
      |              ~~~^~~~~~~~
      |              |       |
      |              |       double
      |              ll {aka long long int}
Language: C++

/*
    coded by - PATHAKCODES ~~Revamped
    AIT PUNE , INDIA 
     
    "The Key is not will to win ......everybody has that "
    "It is will to prepare that is important"  
     
*/
     
#include <bits/stdc++.h>
 
using namespace std ;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
const ll k = 1e9 +7;


int main ()
{
	IOS
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n ;
    cin >> n ;
    vector<ll> a(n,0);

    ll sum = 0;
    for(int i = 0 ; i < n ; i++){
        cin >> a[i];
        sum += a[i];
        sum %= k ;
    }
    ll ans = 0 ;
    for(int i = 0 ;i < n ;i++){
        sum -= a[i];
        if (sum < 0) sum += mod;
        ans += a[i]*sum ;
        ans%=k;
    }

    cout << ans << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:29: error: 'mod' was not declared in this scope; did you mean 'modf'?
   41 |         if (sum < 0) sum += mod;
      |                             ^~~
      |                             modf
Language: C++

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

int main(){
  int N;
  cin >>N;
  vector<int> A(N);
  int mod =10^10+7;
  long long sum = 0;
  for (int i=0; i<N; i++)
  {
    cin >> A[i];
    sum += A[i];
    sum %= mod;
  }
  long ans = 0;
  
  for (int i=0;, i<N; i++)
  {
    sum -= A[i];
    if (sum < 0)
    sum += mod;
    ans += A[i]*sum;
    ans %=mod;
  }
  
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected primary-expression before ',' token
   19 |   for (int i=0;, i<N; i++)
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  ll sum=0;
  ll p=1e9+7;
  for(ll i=0;i<n;i++){
    cin >> a.at(i);
    if(i==0){
      continue;
    }
    sum+=a.at(i);
    sun%=p;
  }
  ll ans=0;
 for(ll i=0;i<n-1;i++){
    ans+=sum*a.at(i);
    sum=sum-a.at(i+1);
   if(sum<0){
     sum=sum+p;
   }
    ans=ans%p;
  }
  cout << ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sun' was not declared in this scope; did you mean 'sum'?
   17 |     sun%=p;
      |     ^~~
      |     sum
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  ll sum=0;
  ll p=1e9+7;
  for(ll i=0;i<n;i++){
    cin >> a.at(i);
    if(i==0){
      continue;
    }
    sum+=a.at(i);
    sun%=p;
  }
  ll ans=0;
 for(ll i=0;i<n-1;i++){
    ans+=sum*a.at(i);
   cout << sum << endl;
    sum=sum-a.at(i+1);
   if(sum<0){
     sum=sum+p;
   }
    ans=ans%p;
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sun' was not declared in this scope; did you mean 'sum'?
   17 |     sun%=p;
      |     ^~~
      |     sum
Language: C++

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

#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define present(t, x) (t.find(x) != t.end())
#define sz(a) int((a).size())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;

const int MOD = (int) 1e9+7;
const int INF = (int) 1e9+1;
inline ll gcd(ll a,ll b){ll r;while(b){r=a%b;a=b;b=r;}return a;}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int n;

void inp(){
	cin>>n;
	ll sum[n+1];
	sum[0]=0;
	FOR(i,0,n){
		int x;cin>>x;
		sum[i+1]=sum[i]+x;
	}
	ll res=0;
	FOR(i,0,n){
		res+=(a[i]%MOD*(sum[n]-sum[i+1])%MOD)%MOD;
		res%=MOD;
	}
	cout<<res<<endl;
}
int main(){
	inp();
	return 0;
}


Compiler output:
a.cc: In function 'void inp()':
a.cc:40:23: error: 'a' was not declared in this scope
   40 |                 res+=(a[i]%MOD*(sum[n]-sum[i+1])%MOD)%MOD;
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define m 1000000007
typedef long long ll;

int main()
{
  ll n;
  cin>>n;
  ll i,j,sum=0,x=0;
  ll a[n];
  for(ll i;i<n;i++)
  {
    cin>>a[i];
    sum=sum+a[i];
   
  }
  for(ll i=0;i<n;i++)
  {
    sum=sum-a[i];
    x=x%m + a[i]%m*sum%m
      x=x%m;
}
  cout<<x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected ';' before 'x'
   22 |       x=x%m;
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define m 1000000007
typedef long long ll;

int main()
{
  ll n;
  cin>>n;
  ll i,j,m,sum=0,x=0;
  ll a[n];
  for(ll i;i<n;i++)
  {
    cin>>a[i];
    sum=sum+a[i];
   
  }
  for(ll i=0;i<n;i++)
  {
    sum=sum-a[i];
    x=x%m + a[i]%m*sum%m
      x=x%m;
}
  cout<<x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:11: error: expected unqualified-id before numeric constant
    3 | #define m 1000000007
      |           ^~~~~~~~~~
a.cc:10:10: note: in expansion of macro 'm'
   10 |   ll i,j,m,sum=0,x=0;
      |          ^
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum=sum+a[i];
      |     ^~~
a.cc:20:5: error: 'sum' was not declared in this scope
   20 |     sum=sum-a[i];
      |     ^~~
a.cc:21:5: error: 'x' was not declared in this scope
   21 |     x=x%m + a[i]%m*sum%m
      |     ^
a.cc:24:9: error: 'x' was not declared in this scope
   24 |   cout<<x;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define m 1000000007
typedef long long ll;

int main()
{
  ll n;
  cin>>n;
  ll i,j,m,sum=0,x=0;
  ll a[n];
  for(ll i;i<n;i++)
  {
    cin>>a[i];
    sum=sum+a[i];
   
  }
  for(ll i=0;i<n;i++)
  {
    sum=sum-a[i];
    x=x%m + a[i]%m*sum%m
      x=x%m;
}
  cout<<x;


Compiler output:
a.cc: In function 'int main()':
a.cc:3:11: error: expected unqualified-id before numeric constant
    3 | #define m 1000000007
      |           ^~~~~~~~~~
a.cc:10:10: note: in expansion of macro 'm'
   10 |   ll i,j,m,sum=0,x=0;
      |          ^
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum=sum+a[i];
      |     ^~~
a.cc:20:5: error: 'sum' was not declared in this scope
   20 |     sum=sum-a[i];
      |     ^~~
a.cc:21:5: error: 'x' was not declared in this scope
   21 |     x=x%m + a[i]%m*sum%m
      |     ^
a.cc:24:9: error: 'x' was not declared in this scope
   24 |   cout<<x;
      |         ^
a.cc:24:11: error: expected '}' at end of input
   24 |   cout<<x;
      |           ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <bitset>

#define _GLIBCXX_DEBUG
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define p_b push_back
#define e_b emplace_back
#define m_p make_pair
#define m_t make_tuple

using namespace std;

int main() {
	ll md = 1000000007, ans = 0, sum=0;
	int n;
	cin >> n;
	vector<ll> vec(n);

	rep(i, n) {
		cin >> vec[i];
		sum += vec[i];
		sum %= md;
	}

	rep(i, n) {
		sum -= vec[i];
		if (sum < 0) sum += mod;
		ans += vec[i] * sum;
		ans %= md;
	}

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:37: error: 'mod' was not declared in this scope; did you mean 'md'?
   33 |                 if (sum < 0) sum += mod;
      |                                     ^~~
      |                                     md