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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector(int64_t) a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  int64_t all = 0;
  for(int i = 0; i < n; i++){
    all += a[i];
  }
  int64_t ans = 0;
  int64_t p = 1e+7;
  for(int i = 0; i < n; i++){
    all -= a[i];
    ans += a[i] * all;
  }
  cout << ans % p << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: missing template arguments before '(' token
    7 |   vector(int64_t) a(n);
      |         ^
a.cc:7:17: error: expected primary-expression before ')' token
    7 |   vector(int64_t) a(n);
      |                 ^
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a[i];
      |            ^
a.cc:13:12: error: 'a' was not declared in this scope
   13 |     all += a[i];
      |            ^
a.cc:18:12: error: 'a' was not declared in this scope
   18 |     all -= a[i];
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<long long> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  long long all = 0;
  for(int i = 0; i < n; i++){
    all += a[i];
  }
  long long ans = 0;
  for(int i = 0; i < n; i++){
    all -= a[i];
    ans += a[i]*all;
  }
  cout << ans << endl;
}
    

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

M = 1000000007;
n = int(input())
a = list(map(int,input().split()))
S = [0]
for i in range(n):
 S.append(S[-1]+a[i])%M
sum = 0
for i in range(n-1):
 sum += (a[i]*(S[n]-S[i+1]))%M
print(sum%M)

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

#include<cstdio>
using namespace std;
const int N=2e5+5;
const int mo=1e9+7;
int n,ans,a[N];
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=n-1;i;i--) b[i]=(b[i+1]+a[i])%mo;
	for (int i=1;i<n;i++) ans=(ans+(long long)a[i]*b[i+1])%mo;
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: 'b' was not declared in this scope
   10 |         for (int i=n-1;i;i--) b[i]=(b[i+1]+a[i])%mo;
      |                               ^
a.cc:11:56: error: 'b' was not declared in this scope
   11 |         for (int i=1;i<n;i++) ans=(ans+(long long)a[i]*b[i+1])%mo;
      |                                                        ^
Language: C

#include<stdio.h>
int main ()
{
	long long int A[222222];
	int n;
	scanf("%d",&n);
	long long int sum=0;
	long long int num=0;
	int i;
	for(i=0;i<n;i++){
		scanf("%lld",&A[i]);
		sum+=A[i]*num;
		num+=A[i];ll
	}
	printf("%lld",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:27: error: 'll' undeclared (first use in this function)
   13 |                 num+=A[i];ll
      |                           ^~
main.c:13:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: expected ';' before '}' token
   13 |                 num+=A[i];ll
      |                             ^
      |                             ;
   14 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)



int main(){
  int N;  
  
cin>>N;
vector<int>a(N);
rep(i,N)cin>>a[i];
int sum=0,x=0;
for(int i=0;i<N;i++){
  sum+=a[i]%mod*x;
  x+=a[i];
}
cout<<sum<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'mod' was not declared in this scope
   18 |   sum+=a[i]%mod*x;
      |             ^~~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    final Scanner sc = new Scanner(System.in);
    final int num = sc.nextInt();
    final List<Long> a = new ArrayList<Long>();
    final long mod = (int) Math.pow(10, 9) + 7;

    for (int i = 0; i < num; i++) {
      a.add(sc.nextLong());
    }

    Long sum = 0L;
    for (int i = 1; i < a.size(); i++) {
      sum = (sum + a.get(i)) % mod;
    }

    Long total = 0L;
    for (int i = 0; i < a.size(); i++) {
      if (i != 0) {
        sum -= a.get(i);
      }
      if (sum == 0) {
        sum = 1;
      }
      final Long addedNum = (a.get(i) * sum) % mod;
      total += addedNum;
      total %= mod;
    }

    System.out.println(total);
  }
}

Compiler output:
Main.java:27: error: incompatible types: int cannot be converted to Long
        sum = 1;
              ^
1 error
Language: C++

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace atcoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var buffer = Console.ReadLine().Split();
            var A = new List<long>();
            foreach (var v in buffer)
                A.Add(long.Parse(v));

            var list = new List<long>();
            list.Add(0);
            for (int i = 0; i < N; i++)
                list.Add(list[i] + A[i]);

            long ans = 0;
            for (int i = 0; i < N; i++)
            {
                ans += A[i] * (list[N] - list[i + 1]) % 1000000007;
            }
            Console.WriteLine(ans % 1000000007);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:8:5: error: expected unqualified-id before 'public'
    8 |     public class Program
      |     ^~~~~~
Language: C++

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

int mod = (int)1e9 + 7;

int safe_mod(long long x, int m) {
  x %= m;
  if (x < 0) {
    x += m;
  }
  return x;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum = safe_mod(sum + a[i]);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    sum = safe_mod(sum - a[i]);
    int prod = safe_mod((long long)a[i] * sum);
    ans = (ans + prod) % mod;
  }
  cout << ans << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: too few arguments to function 'int safe_mod(long long int, int)'
   23 |     sum = safe_mod(sum + a[i]);
      |           ~~~~~~~~^~~~~~~~~~~~
a.cc:6:5: note: declared here
    6 | int safe_mod(long long x, int m) {
      |     ^~~~~~~~
a.cc:27:19: error: too few arguments to function 'int safe_mod(long long int, int)'
   27 |     sum = safe_mod(sum - a[i]);
      |           ~~~~~~~~^~~~~~~~~~~~
a.cc:6:5: note: declared here
    6 | int safe_mod(long long x, int m) {
      |     ^~~~~~~~
a.cc:28:24: error: too few arguments to function 'int safe_mod(long long int, int)'
   28 |     int prod = safe_mod((long long)a[i] * sum);
      |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:5: note: declared here
    6 | int safe_mod(long long x, int m) {
      |     ^~~~~~~~
Language: Java

import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
      	long[] arr = new long[N];
      	for(int i=0; i<N; i++) arr[i] = sc.nextLong();
      	long[] sumArr = new long[N];
      	long sum = 0;
      
      	long mod = 1000000000 + 7;
      
      for(int i= N-1; i>=0; i--){
        sum = (sum + arr[i])%mod;
        arrSum[i] = sum;
      }
      
      	long res = 0;
      for(int i=0; i<N-1; i++){
        long nextSum = sumArr[i+1];
          res = (res + (arr[i] * nextSum)%mod)%mod;
      }
      	System.out.println(res);
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
        arrSum[i] = sum;
        ^
  symbol:   variable arrSum
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 2e9
#define LINF 1e18
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (ll)(n); i++)
#define input(x, n)for(int i = 0; i <(ll)(n); i++)cin >> x[i];
#define until(i,n) for(int i = 1; i <= (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << "=" << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO")
#define Yes(n) cout << ((n) ? "Yes" : "No")
#define PI 3.141592653589793

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

    ll ans = 0;

    rep(i, n){
        ll sum = (B[n] - B[i+1])%MOD;
        ans += a[i]*sum;
        ans %= MOD;
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'A' was not declared in this scope
   25 |         B[i+1] = B[i]+A[i];
      |                       ^
Language: C++

#include <bits/stdc++.h>

#define F first
#define S second
#define ll long long
#define pb push_back
#define endl '\n'

using namespace std;

const int MOD = 1e9 + 7;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> v(n);
    for (int &i : v)
        cin >> i;
    ll sum = accumulate(v.begin(), v.end(), 0);
    ll ans = 0;
    sum -= v[0];
    for (int i = 1; i < n; ++i) {
        ans = ans + (sum * v[i-1]) % MOD;
        sum -= v[i];
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   18 |     for (int &i : v)
      |                   ^
Language: C++

#include <iostream>
using namespace std;
#define ll long long
#define co cout
#define ne "\n"
#define vll vector<ll>
#define pb push_back

const ll mod = 1e9 + 7;

int main(){
   ll n,m;
   cin >> n;
   vll v(n);
   for(ll i = 0;i<n;i++){
       cin >> m;
       v.pb(m);
   }
   ll ans = 1;
   for (ll j =0,k = j+1;j<=n-2;k++){
       if(k==n-1){
           ans += (a[j]%mod)*(a[k]%mod);
           ans = ans%mod;
           j++;
           k = j+1;
       }
       else{
           ans += (a[j]%mod)*(a[k]%mod);
           ans = ans %mod;
           
           
           
           
       }
   }
   
   
   co  << ans;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'vector' was not declared in this scope
    6 | #define vll vector<ll>
      |             ^~~~~~
a.cc:14:4: note: in expansion of macro 'vll'
   14 |    vll 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:3:12: error: expected primary-expression before 'long'
    3 | #define ll long long
      |            ^~~~
a.cc:6:20: note: in expansion of macro 'll'
    6 | #define vll vector<ll>
      |                    ^~
a.cc:14:4: note: in expansion of macro 'vll'
   14 |    vll v(n);
      |    ^~~
a.cc:17:8: error: 'v' was not declared in this scope
   17 |        v.pb(m);
      |        ^
a.cc:22:20: error: 'a' was not declared in this scope
   22 |            ans += (a[j]%mod)*(a[k]%mod);
      |                    ^
a.cc:28:20: error: 'a' was not declared in this scope
   28 |            ans += (a[j]%mod)*(a[k]%mod);
      |                    ^
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        long[] arr = new long[n];
        for(int i=0; i<n; i++)
            arr[i] = Integer.parseInt(input[i]);
        long sum = 0;
        for(int i=n-1; i>=0; i--) {
            sum += arr[i];
        }
        long MOD = 1000000007;
        long ans = 0;
        for(int i=0; i<n; i++) {
            sum -= arr[i];
            if(sum < 0)
                sum += MOD;
            long add = arr[i] * sum;
            ans += add;
            ans = ans % MOD
        }
        System.out.println(ans % MOD);
        br.close();
    }
}

Compiler output:
Main.java:25: error: ';' expected
            ans = ans % MOD
                           ^
1 error
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        long[] arr = new long[n];
        for(int i=0; i<n; i++)
            arr[i] = Integer.parseInt(input[i]);
        long sum = 0;
        for(int i=n-1; i>=0; i--) {
            sum += arr[i];
        }
        long MOD = 1000000007;
        long ans = 0;
        for(int i=0; i<n; i++) {
            sum -= arr[i];
            if(sum < 0)
                sum += MOD;
            long add = arr[i] * dp[i+1];
            ans = (ans % MOD + add % MOD) % MOD;
        }
        System.out.println(ans % MOD);
        br.close();
    }
}

Compiler output:
Main.java:23: error: cannot find symbol
            long add = arr[i] * dp[i+1];
                                ^
  symbol:   variable dp
  location: class Main
1 error
Language: C++

#include <iostream>
#include <fstream>   

using namespace std;

long main() {

	long* a; 
	long n;

	cin >> n;

	a = (long*)malloc(n * sizeof(long)); 

	for (long i = 0; i < n; i++) {
		a[i] = 0;
	}

	for (long i = 0; i < n; i++) {
		long a_temp;
		cin >> a_temp;
		a[i] = a_temp;
	}

	for (long i = 0; i < n; i++) {
		//cout << a[i] << endl;
	}


	long res = 0;
	for (long j = n - 1; j > 0;j--) {
		for (long i = 0; i < j; i++) {
			//cout << i << " " << j << endl;
			res += a[i] * a[j];
		}

	}

	cout << res;

	free(a);

	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
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 (int i=1; i<n; i++){
		total += a[i] * (s[n]-s[i]) % MOD; 
	}
	
	cout << total % MOD.0;
	return 0; 
} 



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

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

const int MOD=1000000007;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'll0' was not declared in this scope
    8 |         long long s=ll0;
      |                     ^~~
a.cc:11:18: error: conflicting declaration 'int s [n]'
   11 |         int a[n],s[n];
      |                  ^
a.cc:8:19: note: previous declaration as 'long long int s'
    8 |         long long s=ll0;
      |                   ^
a.cc:15:18: error: invalid types 'long long int[int]' for array subscript
   15 |                 s[n]+=a[i-1]+a[i];
      |                  ^
a.cc:19:26: error: invalid types 'long long int[int]' for array subscript
   19 |                 s+=a[i]*s[i];
      |                          ^
Language: Java

import java.util.*;

public class Main{
		public static void main(String[] args){
        Scanner sc =new Scanner(System.in);	
          int n = sc.nextInt();
          int c;
          long[] a = new long[100];
          for(int i=1;i<=n;i++){
          	for(int j=i+1;j<n;j++){
              	c = c + i*j;
           		System.out.println(c);
            }
          }
        }
}

Compiler output:
Main.java:11: error: variable c might not have been initialized
              	c = c + i*j;
              	    ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rei(i,a,n) for(int i=(a);i<(n);i++)
#define red(i,a,n) for(int i=(a)-1;i>=(n);i--)
#define rep(i,n) rei(i,0,n)
#define rem(i,n) red(i,n,0)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
int msb(ll x)
{
    union{double a;int32_t b[2];};
    a=x;
    return (b[1]>>20)-1023;
}
int mx=(int)1e9+7;
void sol()
{
    int n;
    ll s=0;
    cin>>n;
    vi a(n);
    rep(i,n)
    {
        cin>>a[i];
        s+=a[i];
    }
    s%=mx;
    rep(i,n)
    {
        ans+=s*a[i];
        ans%=mx;
    }
    if(ans&1)ans=(ans+mx)/2;
    else ans/=2;
    cout<<ans;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)sol();
}

Compiler output:
a.cc: In function 'void sol()':
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |         ans+=s*a[i];
      |         ^~~
      |         abs
a.cc:42:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |     if(ans&1)ans=(ans+mx)/2;
      |        ^~~
      |        abs
a.cc:44:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   44 |     cout<<ans;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
	ll N, mod = 1000000007;
	cin >> N;
	vector<ll> X(N);
	rep(i, N) { cin >> X.at(i); }
	ll A = 0, B = 0;
	rep(i, N) {
		A += X.at(i);
		A %= mod;
		B += X.at(i) * X.at(i);
		B %= mod;
	}
	ll pre = (A * A - B) % mod;
	if (pre % 2 = 0) {
		cout << pre / 2;
	} else {
		cout << (pre + mod) / 2;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: lvalue required as left operand of assignment
   19 |         if (pre % 2 = 0) {
      |             ~~~~^~~
Language: C++

#includ <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t n,x,y;
  cin>>n;
  x=0;
  y=0;
  vector<int64_t>a(n);
  for(int64_t i=0;i<n;i++){
    cin>>a.at(i);
    x=(x+a.at(i))%1000000007;
    y=(y+a.at(i)*a.at(i))%1000000007;
  }
    cout<<((x*x-y+9000000063)%1000000007)/2<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'int64_t' was not declared in this scope
    5 |   int64_t n,x,y;
      |   ^~~~~~~
a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | #includ <bits/stdc++.h>
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #includ <bits/stdc++.h>
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n;
      |        ^
a.cc:7:3: error: 'x' was not declared in this scope
    7 |   x=0;
      |   ^
a.cc:8:3: error: 'y' was not declared in this scope
    8 |   y=0;
      |   ^
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int64_t>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 | #includ <bits/stdc++.h>
a.cc:9:18: error: 'a' was not declared in this scope
    9 |   vector<int64_t>a(n);
      |                  ^
a.cc:10:14: error: expected ';' before 'i'
   10 |   for(int64_t i=0;i<n;i++){
      |              ^~
      |              ;
a.cc:10:19: error: 'i' was not declared in this scope
   10 |   for(int64_t i=0;i<n;i++){
      |                   ^
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout<<((x*x-y+9000000063)%1000000007)/2<<endl;
      |     ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:46: error: 'endl' was not declared in this scope
   15 |     cout<<((x*x-y+9000000063)%1000000007)/2<<endl;
      |                                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includ <bits/stdc++.h>
Language: C++

//invincible M15
//IIT-(ISM)Dhanbad
#include<bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define pi  3.141592653589793238462643383279
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=(int)x; i<y; i++)
#define high_functioning_sociopath  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const unsigned int M = 1000000007;
/*------------------------------------- THE GAME IS ON ---------------------------------------------*/
void solve()
{
     ll n;
     cin>>n;
     vector<ll>v(n),pref(n);
     for(int i=0;i<n;i++)cin>>v[i];
     pref[0]=v[0];
     for(int i=1;i<n;i++)
     {
            pref[i]=((pref[i-1]%M)+(v[i]%M))%M;
     }
     ll ans=0;
     for(int i=0;i<n;i++)
     {
           ll z=((((pref[n-1]%M)-(pref[i]%M)%M)*(v[i]%M))%M;
           ans=((ans%M)+(z%M))%M;
     }
     cout<<ans<<endl;
       
}
int32_t main()
{
   high_functioning_sociopath
   ll t=1;
   //cin>>t;
   while(t--)
   {
      solve();
   }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:60: error: expected ')' before ';' token
   31 |            ll z=((((pref[n-1]%M)-(pref[i]%M)%M)*(v[i]%M))%M;
      |                 ~                                          ^
      |                                                            )
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main() {
    int MOD=pow(10,9)+7;
  	int N;
  	cin>>N;
  	int num;
  	vector<int>nums;
  	for(int i=0;i<N;i++){
      cin>>num;
      nums.push_back(num);
    }
  	int sum=0;
 	for(int j=0;j<N;j++){
      sum+=(((pow(2,N-1))*nums[j])%(MOD));
      sum%=MOD;
    }
  	cout<<sum<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<int>nums;
      |         ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <cmath>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:12:16: error: expected primary-expression before 'int'
   12 |         vector<int>nums;
      |                ^~~
a.cc:15:7: error: 'nums' was not declared in this scope; did you mean 'num'?
   15 |       nums.push_back(num);
      |       ^~~~
      |       num
a.cc:19:27: error: 'nums' was not declared in this scope; did you mean 'num'?
   19 |       sum+=(((pow(2,N-1))*nums[j])%(MOD));
      |                           ^~~~
      |                           num
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main() {
    const int MOD=pow(10,9)+7;
  	int N;
  	cin>>N;
  	int num;
  	vector<int>nums;
  	for(int i=0;i<N;i++){
      cin>>num;
      nums.push_back(num);
    }
  	int sum=0;
 	for(int j=0;j<N;j++){
      sum+=(((pow(2,N-1))*nums[j])%MOD);
      sum%=MOD;
    }
  	cout<<sum<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<int>nums;
      |         ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <cmath>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:12:16: error: expected primary-expression before 'int'
   12 |         vector<int>nums;
      |                ^~~
a.cc:15:7: error: 'nums' was not declared in this scope; did you mean 'num'?
   15 |       nums.push_back(num);
      |       ^~~~
      |       num
a.cc:19:27: error: 'nums' was not declared in this scope; did you mean 'num'?
   19 |       sum+=(((pow(2,N-1))*nums[j])%MOD);
      |                           ^~~~
      |                           num
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main() {
    const long long MOD=pow(10,9)+7;
  	int N;
  	cin>>N;
  	int num;
  	vector<int>nums;
  	for(int i=0;i<N;i++){
      cin>>num;
      nums.push_back(num);
    }
  	int sum=0;
 	for(int j=0;j<N;j++){
      sum+=(((pow(2,N-1))*nums[j])%MOD);
      sum%=MOD;
    }
  	cout<<sum<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<int>nums;
      |         ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <cmath>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:12:16: error: expected primary-expression before 'int'
   12 |         vector<int>nums;
      |                ^~~
a.cc:15:7: error: 'nums' was not declared in this scope; did you mean 'num'?
   15 |       nums.push_back(num);
      |       ^~~~
      |       num
a.cc:19:27: error: 'nums' was not declared in this scope; did you mean 'num'?
   19 |       sum+=(((pow(2,N-1))*nums[j])%MOD);
      |                           ^~~~
      |                           num
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

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

    ll ans = 0;

    rep(i, n) {
        ll sum = b[n] - b[i+1];
        ans += a[i] * sum;
        ans %= mod;
    }

    cout << ans << endl;
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const int x=38;
long long sl[x],sz[x];
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) {
        cin>>sl[i];
        sz[i]=(sz[i-1]+sl[i]);
    }
    long long ans=0;
    for(int j=1;j<=n;j++) {
        ans+=(sl[j]%1000000007)*((sz[n]-sz[j])%1000000007);
        ans%=1000000007;
    }
    cout<<ans<<endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const int MAX=2e5+6;
long long sl[MAX],sz[MAX];
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) {
        cin>>sl[i];
        sz[i]=(sz[i-1]+sl[i]);
    }
    long long ans=0;
    for(int j=1;j<=n;j++) {
        ans+=(sl[j]%1000000007)*((sz[n]-sz[j])%1000000007);
        ans%=1000000007;
    }
    cout<<ans;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    int mod = 1000000007;
    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 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: expected unqualified-id before numeric constant
    3 | #define mod 1000000007
      |             ^~~~~~~~~~
a.cc:9:9: note: in expansion of macro 'mod'
    9 |     int mod = 1000000007;
      |         ^~~
Language: C++

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    int mod = 1000000007;
    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 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> A(N);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> A(N);
      |            ^~~
a.cc:9:16: error: 'A' was not declared in this scope
    9 |         cin >> A[i];
      |                ^
a.cc:16:16: error: 'A' was not declared in this scope
   16 |         sum -= A[i];
      |                ^
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << ans << endl;
      |     ^~~~
a.cc:22:20: error: 'endl' was not declared in this scope
   22 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<iostream>
using namespace std;

const int MOD=1000000007;

int main(void){
  int N;
  long A[200001];
  cin >> N;
  for (int i=0; i<N; i++){
    cin >> A[i];
  }
  
  long long sum=0;
  long long dsum=0;
  for (int i=0; i<N; i++){
    sum += A[i];
    dsum += A[i] * A[i];
  }
  
  long long ans=(sum*sum-dsum)/2;
  ans = ans % MOD
  
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected ';' before 'cout'
   22 |   ans = ans % MOD
      |                  ^
      |                  ;
   23 | 
   24 |   cout << ans << endl;
      |   ~~~~
Language: C++

#include<iostream>
using namespace std;

const int MOD=1000000007;

int main(void){
  int N;
  long A[200001];
  cin >> N;
  for (int i=0; i<N; i++){
    cin >> A[i];
  }
  
  long long sum=0;
  long long dsum=0;
  for (int i=0; i<N; i++){
    sum += A[i];
    dsum += A[i] * A[i];
  }
  
  long long ans=(sum*sum-dsum)/2;
  ans = ans % MOD
  
  cout <<  << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected ';' before 'cout'
   22 |   ans = ans % MOD
      |                  ^
      |                  ;
   23 | 
   24 |   cout <<  << endl;
      |   ~~~~
Language: C++

#include<iostream>
using namespace std;

const int MOD=1000000007

int main(void){
  int N;
  long A[200001];
  cin >> N;
  for (int i=0; i<N; i++){
    cin >> A[i];
  }
  
  long long sum=0;
  long long dsum=0;
  for (int i=0; i<N; i++){
    sum += A[i];
    dsum += A[i] * A[i];
  }
  
  long long ans=(sum*sum-dsum)/2;
  ans = ans % MOD
  
  cout <<  << endl;
  
  return 0;
}

Compiler output:
a.cc:6:1: error: expected ',' or ';' before 'int'
    6 | int main(void){
      | ^~~
Language: C

int main() {
  
  int n,i,j,t,p,number[100];
  
  scanf("%d",&n);
  
  // 入力値を配列に格納
  for(t=0; t<n; t++;) {
  	scanf("%d",&number[t]);
  }
  
  for(i=1; i<=sizeof(number); i=i+1) {
  	for(j=i+1; j<=N; j=j+1) {
      p+=number[i]*number[j];
    }
  }
  return p;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:20: error: expected ')' before ';' token
    8 |   for(t=0; t<n; t++;) {
      |      ~             ^
      |                    )
main.c:13:23: error: 'N' undeclared (first use in this function)
   13 |         for(j=i+1; j<=N; j=j+1) {
      |                       ^
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int main() {
  
  int n,i,j,t,p,number[100];
  
  scanf("%d",&n);
  
  // 入力値を配列に格納
  for(t=0; t<n; t++;) {
  	scanf("%d",&number[t]);
  }
  
  for(i=1; i<=sizeof(number); i++) {
  	for(j=i+1; j<=N; j++;) {
      p+=number[i]*number[j];
    }
  }
  return p;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:20: error: expected ')' before ';' token
    8 |   for(t=0; t<n; t++;) {
      |      ~             ^
      |                    )
main.c:13:23: error: 'N' undeclared (first use in this function)
   13 |         for(j=i+1; j<=N; j++;) {
      |                       ^
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: expected ')' before ';' token
   13 |         for(j=i+1; j<=N; j++;) {
      |            ~                ^
      |                             )
Language: C

int main() {
  
  int n,i,j,t,p,number[100];
  
  scanf("%d",&n);
  
  // 入力値を配列に格納
  for(t=0;t<n;t++) {
  	scanf("%d",&number[t]);
  }
  
  for(i=1; i<=sizeof(number); i++) {
  	for(j=i+1; j<=N; j++;) {
      p+=number[i]*number[j];
    }
  }
  return p;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:23: error: 'N' undeclared (first use in this function)
   13 |         for(j=i+1; j<=N; j++;) {
      |                       ^
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: expected ')' before ';' token
   13 |         for(j=i+1; j<=N; j++;) {
      |            ~                ^
      |                             )
Language: C

int main() {
  
  int n,i,j,t,p,number[100];
  
  scanf("%d",&n);
  
  // 入力値を配列に格納
  for(t=0;t<n;t++) {
  	scanf("%d",&number[t]);
  }
  
  for(i=1; i<=sizeof(number); i++) {
  	for(j=i+1; j<=N; j++;) {
      p+=number[i]number[j];
    }
  }
  return p;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:23: error: 'N' undeclared (first use in this function)
   13 |         for(j=i+1; j<=N; j++;) {
      |                       ^
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: expected ')' before ';' token
   13 |         for(j=i+1; j<=N; j++;) {
      |            ~                ^
      |                             )
main.c:14:19: error: expected ';' before 'number'
   14 |       p+=number[i]number[j];
      |                   ^~~~~~
      |                   ;
Language: C++

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

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

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

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

#include<bits/stdc++.h>
using namespace std;
long long m=mod=1e9+7;

long long power(long long x, long long y) 
{ 
    if (y == 0) 
        return 1; 
    long long p = power(x, y/2) % m; 
    p = (p * p) % m; 
  
    return (y%2 == 0)? p : (x * p) % m; 
} 

long long modInverse(long long a) 
{ 
    return power(a, m-2);
}

int main()
{
  	int n;
  	cin>>n;
  	
  	long long sum_sq=0;
  	long long sum=0;
  
  	long long a;
  	for(int i=0;i<n;i++)
    {
      	cin>>a;
      	sum=(sum+a)%mod;
      	sum_sq = (sum_sq + a*a%m)%m;
    }
  	sum=(sum*sum)%mod;
  	sum=(sum-sum_sq + mod)%mod;
  
  	cout<<sum*modInverse(2)%m<<endl;
  
  	return 0;
}

Compiler output:
a.cc:3:13: error: 'mod' was not declared in this scope; did you mean 'modf'?
    3 | long long m=mod=1e9+7;
      |             ^~~
      |             modf
a.cc: In function 'int main()':
a.cc:32:21: error: 'mod' was not declared in this scope; did you mean 'modf'?
   32 |         sum=(sum+a)%mod;
      |                     ^~~
      |                     modf
a.cc:35:23: error: 'mod' was not declared in this scope; did you mean 'modf'?
   35 |         sum=(sum*sum)%mod;
      |                       ^~~
      |                       modf
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll unsigned long long
#define ld long double
#define ff first
#define int ll
#define ss second
#define rsz resize
#define ins insert 
#define mp make_pair
#define pf push_front 
#define pb push_back
#define eb emplace_back 
#define ft front() 
#define bk back()
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define deb(x) cout<<#x<<" "<<x<<'\n';
#define rep(i,a,b) for (int i = (a); i < (b); ++i)

const ll mod = 1e9+7; // 998244353;
const ll inf = 1e18; 
const ld pie = acos((ld)-1);

int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};



int32_t main(){
    
	int n;
	scanf("%lld",&n);
	vector<int> a(n);
	vector<int> prf(n);
	for(int i=0;i<n;++i){
		scanf("%lld",&a[i]);
	}

	prf[0]=a[0];
	for(int i=1;i<n;++i){
		prf[i]=a[i]+prf[i-1];
	}

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

	sum%=mod;
	printf("%lld\n",sum);

	return 0;

	/*STUFF TO LOOK:	
		1. Check the constraints
		2. Corner cases(n==0||n==1)
		3. Variables in loops
		4. Make sure two ints aren’t multiplied to get a long long
		5. Don't use scanf or printf while using ios_base
		6. using the local variable of the same name when global variable was required to be used
	*/
}


Compiler output:
a.cc:27:16: error: narrowing conversion of '-1' from 'int' to 'long long unsigned int' [-Wnarrowing]
   27 | int dx[] = {1, -1, 0, 0};
      |                ^~
a.cc:28:22: error: narrowing conversion of '-1' from 'int' to 'long long unsigned int' [-Wnarrowing]
   28 | int dy[] = {0, 0, 1, -1};
      |                      ^~
Language: C++

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


using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;


int main(){
  const long long C = 1000000007;
  int N;
  cin >> N;
  vector<int> V(N);
  long long sum = 0;
  for(int i= 0; i<N; i++){
    int A;
    cin >> A;
    V[i] = A;
    sum += A;
  }
  long long sum_mod
  for(int i= 0; i<N; i++){
    long long X;
    X = (V[i]*sum)%C;
    sum_mod += X;
    sum -= V[i];
  }
  
  cout << sum_mod%C << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: expected initializer before 'for'
   23 |   for(int i= 0; i<N; i++){
      |   ^~~
a.cc:23:17: error: 'i' was not declared in this scope
   23 |   for(int i= 0; i<N; i++){
      |                 ^
a.cc:30:11: error: 'sum_mod' was not declared in this scope
   30 |   cout << sum_mod%C << endl;
      |           ^~~~~~~
Language: C++

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

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

using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;


int main(){
  const long long C = 1000000007;
  int N;
  cin >> N;
  vector<int> V(N);
  long long sum = 0;
  rep(i, N){
    int A;
    cin >> A;
    V[i] = A;
    sum += A;
  }
  long long sum_mod
  rep(i, N){
    long long X;
    X = (V[i]*sum)%C;
    sum_mod += X;
    sum -= V[i];
  }
  
  cout << sum_mod%C << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: expected initializer before 'for'
    5 | #define rep2(i, m, n) for (int i = m; i < (n); i++)
      |                       ^~~
a.cc:4:19: note: in expansion of macro 'rep2'
    4 | #define rep(i, n) rep2(i, 0, n)
      |                   ^~~~
a.cc:25:3: note: in expansion of macro 'rep'
   25 |   rep(i, N){
      |   ^~~
a.cc:25:7: error: 'i' was not declared in this scope
   25 |   rep(i, N){
      |       ^
a.cc:5:39: note: in definition of macro 'rep2'
    5 | #define rep2(i, m, n) for (int i = m; i < (n); i++)
      |                                       ^
a.cc:25:3: note: in expansion of macro 'rep'
   25 |   rep(i, N){
      |   ^~~
a.cc:32:11: error: 'sum_mod' was not declared in this scope
   32 |   cout << sum_mod%C << endl;
      |           ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define 1000000007 mo
#define long long ll
using namespace std;
int main()
{
  int n,i=0;
  cin>>n;
  ll arr[n];
  while(n--){
    cin>>arr[i];
    i++;
  }ll m=0;
  for(i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      m=m+arr[i]*arr[j];
    }
  }cout<<m%mo<<endl;
  return 0;
}

Compiler output:
a.cc:2:9: error: macro names must be identifiers
    2 | #define 1000000007 mo
      |         ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'll' was not declared in this scope
    9 |   ll arr[n];
      |   ^~
a.cc:11:10: error: 'arr' was not declared in this scope
   11 |     cin>>arr[i];
      |          ^~~
a.cc:13:6: error: expected ';' before 'm'
   13 |   }ll m=0;
      |      ^~
      |      ;
a.cc:16:7: error: 'm' was not declared in this scope
   16 |       m=m+arr[i]*arr[j];
      |       ^
a.cc:16:11: error: 'arr' was not declared in this scope
   16 |       m=m+arr[i]*arr[j];
      |           ^~~
a.cc:18:10: error: 'm' was not declared in this scope
   18 |   }cout<<m%mo<<endl;
      |          ^
a.cc:18:12: error: 'mo' was not declared in this scope
   18 |   }cout<<m%mo<<endl;
      |            ^~
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,sum=0;

    cin >> N;

    vector<ll> A(N,0);

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

    for(int i=0;i<N-1;i++){
        sum -= A[i];
        ans += A[i]*sum;
        ans %= MOD
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: expected ';' before '}' token
   35 |         ans %= MOD
      |                   ^
      |                   ;
   36 |     }
      |     ~
Language: C++

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

#include <atcoder/all>

using namespace std;
using ll = long long;
using ld = long double;

namespace my {
template <typename T>
void input_vec(vector<T> &a, ll n) {
  if (!a.empty()) {
    cout << "wrong argument in input_vec" << endl;
    exit(1);
  }
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
}
template <typename T>
void input_set(set<T> &a, ll n) {
  if (!a.empty()) {
    cout << "wrong argument in input_set" << endl;
    exit(1);
  }
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.insert(tmp);
  }
}

char itoc(int i) { return i + '0'; }
int ctoi(char c) { return c - '0'; }

ll gcd(ll a, ll b) {  // O( log(a) )
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll lcm(ll a, ll b) { return a * (b / my::gcd(a, b)); }  // O( log(a) )

bool isPrime(ll n) {  // O( sqrt(n) )
  bool flag = true;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      flag = false;
      break;
    }
  }
  return flag;
}

vector<pair<ll, ll>> primeFac(ll n) {  // O( sqrt(n) )
  vector<pair<ll, ll>> ret;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i != 0) continue;
    ll exp = 0;
    while (n % i == 0) {
      n /= i;
      exp++;
    }
    ret.push_back(make_pair(i, exp));
  }
  if (n != 1) ret.push_back(make_pair(n, 1));
  return ret;
}
}  // namespace my
////////////////////////////////////////////////

using mint = atcoder::modint1000000007;

int main() {
  ll n;
  cin >> n;
  vector<ll> a;
  my::input_vec(a, n);
  ll sum = 0;
  for (auto &ai : a) {
    sum += ai;
  }

  mint ans = 0;
  for (auto &ai : a) {
    ans += ai * (sum - ai);
  }

  ans *= mint(2).inv();
  cout << ans.val() << endl;
}

Compiler output:
a.cc:4:10: fatal error: atcoder/all: No such file or directory
    4 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.