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

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:17:22: error: expected ')' before ';' token
   17 |   printf("%lld\n",sum;
      |         ~            ^
      |                      )
main.c:18:12: error: expected ';' before '}' token
   18 |   return 0;
      |            ^
      |            ;
   19 | }
      | ~
Language: C++

#include <iostream> 

using namespace std; 
typedef long long ll; 
typedef 1000000007 m;
// required function 

ll findProductSum(ll A[], ll n) 
{ 

    // calculating array sum (a1 + a2  ... + an) 

    ll array_sum = 0; 

    for (ll i = 0; i < n; i++) 

        array_sum = array_sum + A[i]; 

  

    // calcualting square of array sum 

    // (a1 + a2 + ... + an)^2 

    ll array_sum_square = array_sum * array_sum; 

  

    // calcualting a1^2 + a2^2 + ... + an^2 

    ll individual_square_sum = 0; 

    for (ll i = 0; i < n; i++) 

        individual_square_sum += A[i]*A[i]; 

  

    // required sum is (array_sum_square - 

    // individual_square_sum) / 2 

    return (array_sum_square - individual_square_sum)/2; 
} 

  
// Driver code 

int main() 
{ 
  ll n; 
  cin>>n; 
  ll A[n]; 
  for(ll i=0;i<n;i++){ 
    cin>>A[i]; 
    }



    

    cout << findProductSum(A,n)%m<<endl;


    return 0; 
} 

Compiler output:
a.cc:5:9: error: expected unqualified-id before numeric constant
    5 | typedef 1000000007 m;
      |         ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:62:33: error: 'm' was not declared in this scope
   62 |     cout << findProductSum(A,n)%m<<endl;
      |                                 ^
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:13:6: error: 'count' undeclared (first use in this function)
   13 |     {count++;
      |      ^~~~~
main.c:13:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:22: error: expected ')' before ';' token
   17 |   printf("%lld\n",sum;
      |         ~            ^
      |                      )
main.c:18:12: error: expected ';' before '}' token
   18 |   return 0;
      |            ^
      |            ;
   19 | }
      | ~
Language: C++

#include <bits/stdc++.h>

#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair  
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) <<"#" <<endl
#define PI 3.1415926535
using namespace std;
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
const ll mod = 1e9+7;
const ll MAX = 2e5+23;
const ll inf = 1e18+7;

ll a[MAX],dp[MAX],sum[MAX];
int main(){
  fastio;
  ll n;
  cin>>n;
  f(i,0,n){
    cin>>a[i];
  }
  f(i,0,n){
    (sum[i+1]+=a[i])%=mod;
    (sum[i+1]+=sum[i])%=mod;
  }
  f(i,1,n+1){
    dp[i] = (((sum[i-1]*a[i-1])%mod)+dp[i-1])%moad;
  }
  cout<<dp[n]%mod<<"\n";
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:47: error: 'moad' was not declared in this scope; did you mean 'mod'?
   43 |     dp[i] = (((sum[i-1]*a[i-1])%mod)+dp[i-1])%moad;
      |                                               ^~~~
      |                                               mod
Language: C++

#include<stdio.h>
using namespace std;
const int M = 1000000007;
int main(){
  int n;
  cin >> n;
  long long a[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i];
  }
  int j;
  long long sum=0;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      sum=(sum%M+((a[i]%M*a[j]%M)%M)%M)%M;
    }
  }
  cout <<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout <<sum;
      |   ^~~~
a.cc:19:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int main()
{
	ll n;
    cin >> n;
  vector<ll> a(n);
  	for(int i = 0; i <n; ++i)
      	cin >> a[i];
  ll ans = 0;
  for(i = 0; i < n; ++i)
  {
    for(int j = i; j < n; ++j)
    {
    	ans = (ans%mod +  (a[i]*a[j])%mod)%mod;
    }
  }
  cout << ans;
}
  

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

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int n;	cin>>n;
  vector<long long int> A(n, 0);
  for(long long int i=0; i<n; i++)	cin>>A[i];
  
  long long int ans=0;
  for(long long int i=0; i<n; i++)
  {
    for(long long int j=i+1; j<n; j++)
    {
      ans =  (ans + A[i]*A[j]%1000000007)%%1000000007;
    }
  }
  
  cout<<ans;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:43: error: expected primary-expression before '%' token
   18 |       ans =  (ans + A[i]*A[j]%1000000007)%%1000000007;
      |                                           ^
Language: C++

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

#define ll long long
#define ar array

const int mxN=1e9,INF=999999999;
const int modr=1e9+7;
int  n,a[mxN], c[2*100*mxN+1];

/* 1. If you can't keep solution in mind, then visualize it on a paper.
 * 2. Try to identify the type of problem - DP, Greedy, Graph, Constructive, 
 * 	  Prefix/Suffix, Difference Array, BIT/Segment Tree, etc.
 * 3. Look at the problems from different perspectives - reverse the problem, 
 * 	  add instead of delete (maybe?)
 * 4. Divide difficult solutions into cases and/or sequences.
 * 5. Use math rules to solve Nested Summation.
 * 6. Optimisation problems are generally solved with DP, greedy, binary search or brute-force.
 * ------------------------------------------------------------------ 
 */

void solve() {
    string s,t;
	cin >> n;
	for(int i=0;i<n;i++){
	    cin>>a[i];
	}
	ll sum=0;
	for(int i=0;i<n;i++){
	    for(int j=i+1;j<n;j++){
	        sum=(sum+a[i]*a[j])%modr;
	    }
	}
	cout<<sum;
}

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

	int t=1;

	for(int i=1; i<=t; ++i) {
	//	cout << "Case #" << i << ": ";
		solve();
	}
}



Compiler output:
a.cc:9:23: warning: integer overflow in expression of type 'int' results in '-1863462912' [-Woverflow]
    9 | int  n,a[mxN], c[2*100*mxN+1];
      |                  ~~~~~^~~~
a.cc:9:27: error: size '-1863462911' of array 'c' is negative
    9 | int  n,a[mxN], c[2*100*mxN+1];
      |                  ~~~~~~~~~^~
Language: C++

#iclude<bits/stdc++.h>
using namespace std;
int main(){
int a;
  cin>>a;
  int b[a];
  for(int i=0;i<a;i++)cin>>b[i];
  long int sum=0;
  for(int i=0;i<a-1;i++){
  for(int j=i+1;j<a;j++)sum+=(b[i]*b[j])%1000000007;
  }
cout<<sum;

return 0}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude<bits/stdc++.h>
a.cc:12:1: error: 'cout' was not declared in this scope
   12 | cout<<sum;
      | ^~~~
a.cc:12:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:9: error: expected ';' before '}' token
   14 | return 0}
      |         ^
      |         ;
Language: C++

# define m 1000000007
int main() {
	
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
    cout.tie(NULL);
	
	ll n;
	cin>>n;
	ll a[n];
	ll sum=0;
	for(ll i=0;i<n;i++)
	{
	    cin>>a[i];
	    a[i]=a[i]%m;
	    sum+=a[i];
	    sum=sum%m;
	}
	
	ll ans=0;
	for(ll i=0;i<n;i++)
	{
	    ans+=((sum-a[i])*a[i])%m;
	    ans=ans%m;
	}
	cout<<ans/2<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'ios_base' has not been declared
    4 |         ios_base::sync_with_stdio(false);
      |         ^~~~~~~~
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin.tie(NULL);
      |     ^~~
a.cc:5:13: error: 'NULL' was not declared in this scope
    5 |     cin.tie(NULL);
      |             ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | # define m 1000000007
a.cc:6:5: error: 'cout' was not declared in this scope
    6 |     cout.tie(NULL);
      |     ^~~~
a.cc:8:9: error: 'll' was not declared in this scope
    8 |         ll n;
      |         ^~
a.cc:9:14: error: 'n' was not declared in this scope
    9 |         cin>>n;
      |              ^
a.cc:10:11: error: expected ';' before 'a'
   10 |         ll a[n];
      |           ^~
      |           ;
a.cc:11:11: error: expected ';' before 'sum'
   11 |         ll sum=0;
      |           ^~~~
      |           ;
a.cc:12:15: error: expected ';' before 'i'
   12 |         for(ll i=0;i<n;i++)
      |               ^~
      |               ;
a.cc:12:20: error: 'i' was not declared in this scope
   12 |         for(ll i=0;i<n;i++)
      |                    ^
a.cc:14:18: error: 'a' was not declared in this scope
   14 |             cin>>a[i];
      |                  ^
a.cc:16:13: error: 'sum' was not declared in this scope
   16 |             sum+=a[i];
      |             ^~~
a.cc:20:11: error: expected ';' before 'ans'
   20 |         ll ans=0;
      |           ^~~~
      |           ;
a.cc:21:15: error: expected ';' before 'i'
   21 |         for(ll i=0;i<n;i++)
      |               ^~
      |               ;
a.cc:21:20: error: 'i' was not declared in this scope
   21 |         for(ll i=0;i<n;i++)
      |                    ^
a.cc:23:13: error: 'ans' was not declared in this scope
   23 |             ans+=((sum-a[i])*a[i])%m;
      |             ^~~
a.cc:23:20: error: 'sum' was not declared in this scope
   23 |             ans+=((sum-a[i])*a[i])%m;
      |                    ^~~
a.cc:23:24: error: 'a' was not declared in this scope
   23 |             ans+=((sum-a[i])*a[i])%m;
      |                        ^
a.cc:26:15: error: 'ans' was not declared in this scope
   26 |         cout<<ans/2<<endl;
      |               ^~~
a.cc:26:22: error: 'endl' was not declared in this scope
   26 |         cout<<ans/2<<endl;
      |                      ^~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
 	int a,b,c,i,j,n;	
  	int ans = 0;
  	int a[200001] = {0};
  	int m = 1000000007;
  scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%d",&a[i]); 
  }
  
  for(i=0;i<n-1;i++){
   for(j=i+1;j<n;j++){
     if(a[i]*a[j]>=m){
      ans+=(a[i]*a[j])%m; 
     }else{
      ans+=a[i]*a[j]; 
     }
     if(ans>=m){
      ans-=m; 
     }
   }
  }
    
  printf("%d",ans);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:13: error: conflicting types for 'a'; have 'int[200001]'
    6 |         int a[200001] = {0};
      |             ^
main.c:4:13: note: previous declaration of 'a' with type 'int'
    4 |         int a,b,c,i,j,n;
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n;
  cin>>n;
  long long int a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  long long int sum = 0;
  for(int i=0;i<n;i++)
  {
    sum = (sum+a[i])%(1000000007);
  }
  long long int sqr = (sum*sum)%(1000000007);
  long long int ind = 0;
  for(int i=;i<n;i++)
  {
    ind=(ind+(a[i]*a[i])%(1000000007))%(1000000007);
  }
  cout<<(sqr-ind)/2;
}

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

#include<stdio.h>
using namespace std;
const int M = 1000000007;
int main(){
  int n;
  cin >> n;
  long long a[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i];
  }
  int j;
  long long sum=0;
  for(i=0;i<n;i++){
    for(j=i+1,j<n;j++){
      sum=(sum%M+((a[i]%M*a[j]%M)%M)%M)%M;
    }
  }
  cout <<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:15:22: error: expected ';' before ')' token
   15 |     for(j=i+1,j<n;j++){
      |                      ^
      |                      ;
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout <<sum;
      |   ^~~~
a.cc:19:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include<stdio.h>
#include<string.h>
int main(){
 	int a,b,c,i,j,n;	
  	int ans = 0;
  	int a[200001] = {0};
  	int m = 1000000007;
  scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%d",&a[i]); 
  }
  
  for(i=0;i<n-1;i++){
   for(j=i+1;j<n,j++){
     if(a[i]*a[j]>=m){
      ans+=(a[i]*a[j])%m; 
     }else{
      ans+=a[i]*a[j]; 
     }
     if(ans>=m){
      ans-=m; 
     }
   }
  }
    
  printf("%d",ans);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:13: error: conflicting types for 'a'; have 'int[200001]'
    6 |         int a[200001] = {0};
      |             ^
main.c:4:13: note: previous declaration of 'a' with type 'int'
    4 |         int a,b,c,i,j,n;
      |             ^
main.c:14:21: error: expected ';' before ')' token
   14 |    for(j=i+1;j<n,j++){
      |                     ^
      |                     ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long m[200005];
int main(){
  long long n;
  cin>>n;
  long long ans=0,c=0;
  for(int i=0;i<n;i++){
    cin>>m[i];
    ans+=m[i];
  }
  for(int i=0;i<n;i++){
    int t=ans-m[i];
    cnt+=t*m[i];
    cnt%=1000000007;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |     cnt+=t*m[i];
      |     ^~~
      |     int
Language: C

#include<stdio.h>
#include<string.h>
int main(){
 	int a,b,c,i,j,n;	
  	int ans = 0;
  	int a[200001] = {0};
  	int m = 1000000007;
  scanf("%d",n);
  for(i=0;i<n;i++){
   scanf("%d",&a[i]); 
  }
  
  for(i=0;i<n-1;i++){
   for(j=i+1;j<n,j++){
     if(a[i]*a[j]>=m){
      ans+=(a[i]*a[j])%m; 
     }else{
      ans+=a[i]*a[j]; 
     }
     if(ans>=m){
      ans-=m; 
     }
   }
  }
    
  printf("%d",ans);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:13: error: conflicting types for 'a'; have 'int[200001]'
    6 |         int a[200001] = {0};
      |             ^
main.c:4:13: note: previous declaration of 'a' with type 'int'
    4 |         int a,b,c,i,j,n;
      |             ^
main.c:14:21: error: expected ';' before ')' token
   14 |    for(j=i+1;j<n,j++){
      |                     ^
      |                     ;
Language: C++

#include <iostream>
#include<vector>

using namespace std;
int main(){
int n;
  cin>>n;
  vector<long long int> v;
  for(int i =0;i<n;i++){
    long long int l;
    cin>>l;
    v.push_back(l);
  }
  longlong int sum=0;
  for(int i =0;i<n-1;i++){
  for(int j =i+1;j<n;j++){
    sum += v[i] * v[j];
  }
  }
    
	cout<<sum<<endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'longlong' was not declared in this scope
   14 |   longlong int sum=0;
      |   ^~~~~~~~
a.cc:17:5: error: 'sum' was not declared in this scope
   17 |     sum += v[i] * v[j];
      |     ^~~
a.cc:21:15: error: 'sum' was not declared in this scope
   21 |         cout<<sum<<endl;
      |               ^~~
Language: C++

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n)  FOR(i,0,(n))

template<int mod = MOD> class modint{
private:
int mMOD = mod, mVal;
public:

    constexpr modint operator * (const modint &r) const noexcept {
    return modint(*this) *= r;
}

    constexpr modint& operator += (const modint &r) noexcept {
    mVal += r.mVal;
    if(mVal > mMOD) mVal -= mMOD;
    return *this;
}

constexpr modint& operator -= (const modint &r) noexcept {
    mVal -= r.mVal;
    if(mVal < 0) mVal += mMOD;
    return *this;
}

    friend ostream& operator << (ostream &os, const modint& x) noexcept {
    return os << x.mVal;
}

friend istream& operator >> (istream &is, modint& x) noexcept {
    return is >> x.mVal;
}

};

using mint = modint<MOD>;//MODを入力

constexpr mint modpow(const mint &a, int n) noexcept {
    if(n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if(n & 1) t = t * a;
    return t;
}

class CSumOfProductOfPairs {
public:
	void solve(std::istream& in, std::ostream& out) {
    int n;
    in >> n;
    vector<mint> a(n);
    REP(i,n) in >> a[i];
    mint sub_sum = 0;
    FOR(i,1,n){
      sub_sum += a[i];
    }
    mint ans = 0;
    REP(i,n-1){
      ans += a[i] * sub_sum;
      sub_sum -= a[i+1];
    }
    out << ans << endl;
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
	CSumOfProductOfPairs solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Compiler output:
a.cc: In function 'constexpr mint modpow(const mint&, long long int)':
a.cc:48:23: error: could not convert '1' from 'int' to 'mint' {aka 'modint<1000000007>'}
   48 |     if(n == 0) return 1;
      |                       ^
      |                       |
      |                       int
a.cc: In member function 'void CSumOfProductOfPairs::solve(std::istream&, std::ostream&)':
a.cc:62:20: error: conversion from 'int' to non-scalar type 'mint' {aka 'modint<1000000007>'} requested
   62 |     mint sub_sum = 0;
      |                    ^
a.cc:66:16: error: conversion from 'int' to non-scalar type 'mint' {aka 'modint<1000000007>'} requested
   66 |     mint ans = 0;
      |                ^
a.cc: In instantiation of 'constexpr modint<mod> modint<mod>::operator*(const modint<mod>&) const [with long long int mod = 1000000007]':
a.cc:50:13:   required from here
   50 |     t = t * t;
      |             ^
a.cc:20:26: error: no match for 'operator*=' (operand types are 'modint<1000000007>' and 'const modint<1000000007>')
   20 |     return modint(*this) *= r;
      |            ~~~~~~~~~~~~~~^~~~
Language: C++

-#include <bits/stdc++.h>
#define ll long long
#define ld long double 
#define For(i, a, n) for(long long i = a; (a < n) ? (i < n) : (i > n); (a < n) ? (i++) : (i--))
#define mod 1000000007
#define pb push_back
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
 
using namespace std;


void solve() {
    ll n;
    cin >> n;
    ll a[n];
    ll sum = 0;
    For(i, 0, n) {
        cin >> a[i];
        sum = (sum % mod + a[i] % mod) % mod;
    }
    ll v = 0;
    ll ans = 0;
    For(i ,0 , n - 1) {
        v = (v % mod + a[i] % mod) % mod;
        ll z = sum - v;
        if(z < 0)
            z = (z + mod) % mod;
        ans = (ans % mod + (z * (a[i] % mod) % mod) % mod) % mod;
    }
    cout << ans << "\n";
}

int main() {
    fio;
    solve();
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | -#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '-' token
    1 | -#include <bits/stdc++.h>
      | ^
a.cc: In function 'void solve()':
a.cc:14:5: error: 'cin' was not declared in this scope
   14 |     cin >> n;
      |     ^~~
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << ans << "\n";
      |     ^~~~
a.cc: In function 'int main()':
a.cc:7:13: error: 'ios_base' has not been declared
    7 | #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |             ^~~~~~~~
a.cc:34:5: note: in expansion of macro 'fio'
   34 |     fio;
      |     ^~~
a.cc:7:47: error: 'cin' was not declared in this scope
    7 | #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                               ^~~
a.cc:34:5: note: in expansion of macro 'fio'
   34 |     fio;
      |     ^~~
a.cc:7:55: error: 'NULL' was not declared in this scope
    7 | #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                                       ^~~~
a.cc:34:5: note: in expansion of macro 'fio'
   34 |     fio;
      |     ^~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | -#include <bits/stdc++.h>
a.cc:7:62: error: 'cout' was not declared in this scope
    7 | #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
      |                                                              ^~~~
a.cc:34:5: note: in expansion of macro 'fio'
   34 |     fio;
      |     ^~~
Language: C++

#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

#define M 1000000007

int main(){
   int n;
   cin>>n;
   vector<int> a(n);
   rep(i, n) cin>>a[i];

   vector<ll> sa(n);
   sa[n-1]=a[n-1];
   for(int i=n-2; i>=0; i--) sa[i]=(sa[i+1]+a[i])%M;

   ll cnt=0;
   rep(i, n-1){
      cnt=(cnt+a[i]*sa[i+1])%M;
   }

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


Compiler output:
a.cc:4:11: error: 'pair' does not name a type
    4 | using P = pair<int,int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
   10 |    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 | #define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
a.cc:11:4: error: 'vector' was not declared in this scope
   11 |    vector<int> a(n);
      |    ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
a.cc:11:11: error: expected primary-expression before 'int'
   11 |    vector<int> a(n);
      |           ^~~
a.cc:12:8: error: 'i' was not declared in this scope
   12 |    rep(i, n) cin>>a[i];
      |        ^
a.cc:12:4: error: 'rep' was not declared in this scope; did you mean 'repit'?
   12 |    rep(i, n) cin>>a[i];
      |    ^~~
      |    repit
a.cc:14:13: error: expected primary-expression before '>' token
   14 |    vector<ll> sa(n);
      |             ^
a.cc:14:15: error: 'sa' was not declared in this scope
   14 |    vector<ll> sa(n);
      |               ^~
a.cc:15:12: error: 'a' was not declared in this scope
   15 |    sa[n-1]=a[n-1];
      |            ^
a.cc:23:4: error: 'cout' was not declared in this scope
   23 |    cout<<cnt<<endl;
      |    ^~~~
a.cc:23:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:15: error: 'endl' was not declared in this scope
   23 |    cout<<cnt<<endl;
      |               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
Language: C++

#include <bits/stdc++.h>
#include <string>
//#include <boost/multiprecision/cpp_int.hpp>
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll  unsigned long long
#define fp cout<<fixed<<setprecision(9);
#define ifor(j,n) for(int i=j ;i<n;i++)
#define jfor(k,n) for(ll j=k ;j<n;j++)
#define pb push_back
#define mod 1000000007
using namespace std;
//using namespace boost::multiprecision;

//Compiler version g++ 6.3.0
int search (vector <long long> v,long long m,int n) 
{ 

    int start = 0;
    int ans = -1; 
    while (start <=n) 
    { 
     int mid = (start + n) / 2;
     if (v[mid] <= m) 
         start = mid + 1;
     else
   { 
   ans = mid; 
   n = mid - 1; 

       } 

    } 
    return ans; 
} 

int main()
{
 FAST 

   int t;
   cin>>t;
  vector<ll>v(t);
  ifor(0,t)
    cin>>v[i];
  ll sum=0;
  for(ll i =0,i<t;i++)
  {
    for(ll j=i+1,j<t;j++)
    {
      sum+=((v[i]%mod)*(v[j]%mod))%mod;
      sum%=mod;
    }
  }
  cout<<sum;
}

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

#include <iostream>
using namespace std;

const int size = 2e5+5;
const long long modulo = 1e9+7;
long long prefix_sum[size];

int main() {
	prefix_sum[0] = 0;
	int n;
	cin>>n;
	long long a;
	for(int i=0; i<n; i++) {
		cin>>a;
		prefix_sum[i+1] = (prefix_sum[i] + a) % modulo;
	}
	long long sum = 0;
	for(int i = 1; i < n; i++) {
		sum = (((prefix_sum[n]-prefix_sum[i]) * (prefix_sum[i] - prefix_sum[i-1]) % modulo) + sum) % modulo;
	}
	cout<<sum<<"\n";
	return 0;
}

Compiler output:
a.cc:6:22: error: reference to 'size' is ambiguous
    6 | long long prefix_sum[size];
      |                      ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:4:11: note:                 'const int size'
    4 | const int size = 2e5+5;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'prefix_sum' was not declared in this scope
    9 |         prefix_sum[0] = 0;
      |         ^~~~~~~~~~
Language: C++

#include<stdio.h>
using name space std;
const int M = 1000000007;
int main(){
  int n;
  cin >> n;
  long long a[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i];
  }
  int j;
  long long sum=0;
  for(i=0;i<n;i++){
    for(j=i+1,j<n;j++){
      sum=(sum%M+((a[i]%M*a[j]%M)%M)%M)%M
    }
  }
  cout <<sum;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'name'
    2 | using name space std;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:15:22: error: expected ';' before ')' token
   15 |     for(j=i+1,j<n;j++){
      |                      ^
      |                      ;
a.cc:16:42: error: expected ';' before '}' token
   16 |       sum=(sum%M+((a[i]%M*a[j]%M)%M)%M)%M
      |                                          ^
      |                                          ;
   17 |     }
      |     ~                                     
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout <<sum;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long 
#define OJ \
        freopen("input.txt","r",stdin); \
        freopen("output.txt","w",stdout);
using namespace std;
int mod=1000000007;

int main()
{
//OJ;
ll ans=0;
 int n,flag=0;
 cin>>n;
 ll int a[n];
 for(int i=0;i<n;i++)
 {
         cin>>a[i];
         if(a[i]==0)
         {
           flag=1;
         }
 }
 if(flag)
 {
         cout<<0;
         return ;
 }
 for(int i=0;i<n-1;i++)
 {
         for(int j=i+1;j<n;j++)
         {
        ans+=(a[i]*a[j])%mod;
             ans%=mod;
         }
 
 }
 cout<<ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |          return ;
      |          ^~~~~~
Language: C++

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

void main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll d,t,s; cin >>d>>t>>s;
	if (d / t <= s and d/s<=t) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}	
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n
    int x;
  x=1;
    vector<int64_t>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);}
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      x=vec.at(i)*vec.at(j);
      x%=1000000007;
    }
  }
  cout<<x<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'int'
    5 |   cin>>n
      |         ^
      |         ;
    6 |     int x;
      |     ~~~  
a.cc:7:3: error: 'x' was not declared in this scope
    7 |   x=1;
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  long s=0;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++) {
    cin >> A.at(i);
  }
  for(int i=0;i<N-1;i++) {
    for(int j=i+1;j<N;i++) {
      s += A.at(i)*A.at(j);
    }
  }
  a = s % 1000000007
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: expected ';' before 'cout'
   16 |   a = s % 1000000007
      |                     ^
      |                     ;
   17 |   cout << a << endl;
      |   ~~~~
Language: C++

#include <iostream>
using namespace std;

#define ll long long
#define arrInput(arr, start, end)    \
    for (ll i = start; i < end; i++) \
        cin >> arr[i];

const int MOD = 1000000007;

int product(int ar[], int n)
{
    int result = 1;
    for (int i = 0; i < n; i++)
        result = (result * ar[i]) % MOD;
    return result;
}

int main()
{
    ll n;
    cin >> n;

    ll arr[n];
    arrInput(arr, 0, n);

    cout << product(arr, n) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: cannot convert 'long long int*' to 'int*'
   27 |     cout << product(arr, n) << endl;
      |                     ^~~
      |                     |
      |                     long long int*
a.cc:11:17: note:   initializing argument 1 of 'int product(int*, int)'
   11 | int product(int ar[], int n)
      |             ~~~~^~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define int long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define f first
#define s second

using namespace std;
void lala()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int powr(int x,int y,int z)
{
	int	ans=1;
	int square=x;
	if(y==0)
	    return 1;
	while(y!=0)
	{
	    if(y%2)
	        ans=ans*square;
	    square=(square*square)%z;
	    y=y/2;
	    if(ans>z)
	        ans=ans%z;
	}
	return ans;
}

int32_t main()
{
std::ios::sync_with_stdio(false);


int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];

int res = 0;
int sum = 0;
for (int i = 0; i < n; i++)
sum = (sum + a[i] + mod) % mod;

for (int i = n - 1; i >= 0; i--)
{
sum = (sum - a[i]) % mod;
res = (res + (a[i] * sum) % mod + mod) % mod;

}
cout << (res + mod) % mod << endl;
return 0;
}
Seen by Manish Sarswat at 1598703834946.



Compiler output:
a.cc:72:1: error: 'Seen' does not name a type
   72 | Seen by Manish Sarswat at 1598703834946.
      | ^~~~
Language: C++

#inlcude<iostream>
#include<vector>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> A(N),B(N+1,0);
  int i;
  for(i=0;i<N;i++) {
    cin >> A[i];
    B[i+1] = (B[i] + A[i])%1000000007;
  }
  long long ans = 0;
  for(i=1;i<N;i++)ans = (ans + A[i]*B[i]%1000000007)%1000000007;
  cout << ans << endl;
}

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

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  long long int a[n],sum=0;
  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])%(1e9+7));
    }
  }
  sum%=1e9+7;
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   18 |       sum+= ((a[i]*a[j])%(1e9+7));
      |              ~~~~~~~~~~~^~~~~~~~
      |                   |          |
      |                   |          double
      |                   long long int
a.cc:21:6: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   21 |   sum%=1e9+7;
      |   ~~~^~~~~~~
a.cc:21:6: note:   in evaluation of 'operator%=(long long int, double)'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n
    int x=1;
    vector<int64_t>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);}
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      x=vec.at(i)*vec.at(j);
      x%=1000000007;
    }
  }
  cout<<x<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'int'
    5 |   cin>>n
      |         ^
      |         ;
    6 |     int x=1;
      |     ~~~  
a.cc:13:7: error: 'x' was not declared in this scope
   13 |       x=vec.at(i)*vec.at(j);
      |       ^
a.cc:17:9: error: 'x' was not declared in this scope
   17 |   cout<<x<<endl;
      |         ^
Language: C++

#include<bit/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  long long int a[n],sum=0;
  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])%(1e9+7));
    }
  }
  sum%=1e9+7;
  cout<<sum<<endl;
}

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

#include<bits/stdc++.h>

using namespace std;

#define endl "\n"
#define lln long long unsigned int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

const int MOD = 1e9 + 7;

int main(){
    IOS;

    int n;
    cin >> n;
    vector<lln> a(n);
    vector<lln> sum(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        if(i==0) sum[i] = a[i];
        else sum[i] = a[i] + sum[i-1];
    }
    lln ans = 0;
    for(int i=0;i<n-1;i++){
        ans = (ans + (a[i] * (sum[n-1] - sum[i])) % MOD ) %MOD;
    }
    cout << ans & MOD << endl;
    return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: invalid operands of types 'const int' and 'const char [2]' to binary 'operator<<'
   27 |     cout << ans & MOD << endl;
      |                   ~~~ ^~
      |                   |
      |                   const int
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n
    int64_t x=1;
    vector<int64_t>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);}
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      x=vec.at(i)*vec.at(j);
      x%=1000000007;
    }
  }
  cout<<x<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'int64_t'
    5 |   cin>>n
      |         ^
      |         ;
    6 |     int64_t x=1;
      |     ~~~~~~~
a.cc:13:7: error: 'x' was not declared in this scope
   13 |       x=vec.at(i)*vec.at(j);
      |       ^
a.cc:17:9: error: 'x' was not declared in this scope
   17 |   cout<<x<<endl;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
#define forn(i,n) for(ll i=0;i < ll (n); i++)

int main()
{
    ll n;
    cin>>n;
    ll a[n];
    ll sum=0;
    forn(i,n) cin>>a[i], sum+=a[i];
    ll ans=0;
    forn(i,n)
    {
        sum-=a[i];
        ans+=((a[i]*(sum%1000000007)%1000000007);
        ans=ans%1000000007;
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:49: error: expected ')' before ';' token
   18 |         ans+=((a[i]*(sum%1000000007)%1000000007);
      |              ~                                  ^
      |                                                 )
Language: C++

#include <iostream>

using namespace std;

int main()
{
    long long n,i,total,result,add;
    cin>>n;
    long long a[200001];
    total=0;
    for(i=/21;i<=n;i++){
        cin>>a[i];
        total+=a[i];
        if(total>1000000007){
            total-=1000000007;
        }
    }

    result=0;
    for(i=1;i<=n;i++){
        add=a[i]*(total-a[i]);
        add%=1000000007;
        result+=add;
        result%=1000000007;
    }
    cout<<result/2<<endl;

    return 0;
}


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

// Efficient C++ program to find sum pair products 
// in an array. 
#include <iostream>
#include<bits/stdc++.h>
#define int long long 
#define e 1000000007
using namespace std; 

// required function 
int findProductSum(int A[], int n) 
{ 
	// calculating array sum (a1 + a2 ... + an) 
	int array_sum = 0; 
	for (int i = 0; i < n; i++) 
		array_sum = array_sum + A[i]; 

	// calcualting square of array sum 
	// (a1 + a2 + ... + an)^2 
	int array_sum_square = array_sum * array_sum; 

	// calcualting a1^2 + a2^2 + ... + an^2 
	int individual_square_sum = 0; 
	for (int i = 0; i < n; i++) 
		individual_square_sum += A[i]*A[i]; 

	// required sum is (array_sum_square - 
	// individual_square_sum) / 2 
	return (array_sum_square - individual_square_sum)/2; 
} 

// Driver code 
int main() 
{ 
int n;
  cin>>n;
  int A[n];
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  cout  << findProductSum(A, n)%e; 
	return 0; 
} 


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

	/**
	*    author:  accesss_denied
	**/
	#include <bits/stdc++.h>
	using namespace std;
	#define ll long long int
	#define ff first
	#define ss second
	#define pb push_back
	#define endl "\n"
	#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	ll mod=1e9+7;			
	ll inf=1e18;

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

				ll t;
				t=1;
				while(t--)
				{
					ll n;
					cin>>n;
					ll arr[n];
					ll sum=0;
					for(ll i=0;i<n;i++)
					{
					cin>>arr[i];
					sum=(sum%mod+arr[i]%mod)%mod;
					}

					ll ans=0;

					for(ll i=0;i<n-1;i++)
					{
						sum-=arr[i];
						sum=(sum%mod);
						ll temp=(arr[i]%mod * sum%mod)%mod;
						ans=(ans%mod + temp%mod)%mod;
						
					}
					ans=ans%mos;
					cout<<ans;
					
				}
				return 0;
			}	




Compiler output:
a.cc: In function 'int main()':
a.cc:46:49: error: 'mos' was not declared in this scope; did you mean 'mod'?
   46 |                                         ans=ans%mos;
      |                                                 ^~~
      |                                                 mod
Language: C++

#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;


signed main() {
    ll n;
    cin >> n;
    vll a(n+1);
    
    ll r = 0;
    ll sum = 0;
    
    rep(i, n) {
        cin >> a[i];
        sum += a[i];
    }
    sum -= a[0];
    
    rep(i, n) {
        r += (a[i] * sum) %=MOD;
        sum -= a[i+1];
    }
    
    mes(r);
    
    
    
        
    
    
    
    
    
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:20: error: lvalue required as left operand of assignment
  103 |         r += (a[i] * sum) %=MOD;
      |              ~~~~~~^~~~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<long long> A(1000000100, 0);
  long long n = 0;
  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++){
      n += A[i]*A[j]
    }
  }
  cout << n%(1000000007);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected ';' before '}' token
   14 |       n += A[i]*A[j]
      |                     ^
      |                     ;
   15 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#include <string>
//#include <boost/multiprecision/cpp_int.hpp>
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll  long long
#define fp cout<<fixed<<setprecision(9);
#define ifor(j,n) for(int i=j ;i<n;i++)
#define jfor(k,n) for(ll j=k ;j<n;j++)
#define pb push_back
#define mod 1000000007
using namespace std;
//using namespace boost::multiprecision;

//Compiler version g++ 6.3.0
int search (vector <long long> v,long long m,int n) 
{ 

    int start = 0;
    int ans = -1; 
    while (start <=n) 
    { 
     int mid = (start + n) / 2;
     if (v[mid] <= m) 
         start = mid + 1;
     else
   { 
   ans = mid; 
   n = mid - 1; 

       } 

    } 
    return ans; 
} 

int main()
{
 FAST 

   int t;
   cin>>t;
  vector<ll>v(t);
  ifor(0,t)
    cin>>v[i];
  ll sum=0;
  ifor(0,t-1)
  {
    jfor(i+1,t)
    {
      sum+=((v[i]%m)*(v[j]%m))%m;
    }
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:19: error: 'm' was not declared in this scope
   50 |       sum+=((v[i]%m)*(v[j]%m))%m;
      |                   ^
Language: C++

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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define fileio freopen("template.in", "r", stdin), freopen("template.out", "w", stdout);
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;

int main() {
    fastio;
    //fileio;
        
    int n;
    cin >> A[n];
    ll A[n];
    ll totalSum = 0;
    ll answer = 0;
    FOR(i, 0, n) {
        cin >> A[i];
        totalSum += A[i];
    }
    FOR(i, 0, n) {
        ll addend = A[i] * (totalSum - A[i]);
        added %= MOD;
        answer += MOD;
        answer %= MOD;
        totalSum -= A[i];
    }
    answer %= MOD;
    cout << answer << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'A' was not declared in this scope
   25 |     cin >> A[n];
      |            ^
a.cc:35:9: error: 'added' was not declared in this scope; did you mean 'addend'?
   35 |         added %= MOD;
      |         ^~~~~
      |         addend
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;
const ll MOD = 1000000007;

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

  ll total = 0;
  rep(i, n){
    ll other = sum - a[i];
    other %= MOD;
    total += (a[i] * other) % MOD;
    total %= MOD;
  }

  cout << total / 2 << endl;

  return 0;
}


Compiler output:
a.cc:28:13: error: extended character   is not valid in an identifier
   28 |     total %= MOD;
      |             ^
a.cc: In function 'int main()':
a.cc:28:13: error: '\U000000a0MOD' was not declared in this scope; did you mean 'MOD'?
   28 |     total %= MOD;
      |             ^~~~
      |             MOD