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

#include<bits/stdc++.h>
using namespace std;
#define ull long long 
int main() {
		ull sum=0,n,no,sum1=0,total=0;
		vector<ull> v;
		cin>>n;
		while(n--)
		{
			cin>>no;
			v.pb(no);
		}
		
		for(ull i=0;i<v.size();i++)
		{
			sum+=((v[i])%mod);
            sum%=mod;
		}
		for(ull i=0;i<v.size();i++)
		{
			sum1+=((v[i])%mod);
            sum1%=mod;
			total+=((v[i]*(sum-sum1)))%mod;
            total%=mod;
		}
		cout<<total%mod;
		return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'class std::vector<long long int>' has no member named 'pb'
   11 |                         v.pb(no);
      |                           ^~
a.cc:16:38: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |                         sum+=((v[i])%mod);
      |                                      ^~~
      |                                      modf
a.cc:21:39: error: 'mod' was not declared in this scope; did you mean 'modf'?
   21 |                         sum1+=((v[i])%mod);
      |                                       ^~~
      |                                       modf
a.cc:26:29: error: 'mod' was not declared in this scope; did you mean 'modf'?
   26 |                 cout<<total%mod;
      |                             ^~~
      |                             modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
define ull long long 
int main() {
		ull sum=0,n,no,sum1=0,total=0;
		vector<ull> v;
		cin>>n;
		while(n--)
		{
			cin>>no;
			v.pb(no);
		}
		
		for(ull i=0;i<v.size();i++)
		{
			sum+=((v[i])%mod);
            sum%=mod;
		}
		for(ull i=0;i<v.size();i++)
		{
			sum1+=((v[i])%mod);
            sum1%=mod;
			total+=((v[i]*(sum-sum1)))%mod;
            total%=mod;
		}
		cout<<total%mod;
		return 0;
	}

Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define ull long long
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<ll,ll>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

ll gcd(ll a,ll b){return b ? gcd(b,a%b) :a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}

ll n;



    vector<pair<ll,ll>>p;
void fs(ll a){
    for(ll i=2;i*i<=n;i++){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        p.emplace_back(i,cnt);
    }
    return;
}


ll di[]={1,0,-1,0};
ll dj[]={0,-1,0,1};
int main()
{
 const ll m=1000000007;
 ll n;
 cin>>n;
 vector<ll>a(n);
 rep(i,n)cin>>a[i];
 rep(i,n)a[i]=a[i]%m;
 vector<ll>v(n-1);
 ll sum=0;
 Rep(i,n)sum+=a[i];
 v[0]=sum;
 Rep(i,n-1){
     v[i]=(v[i-1]-a[i]);
     
 sum=0;
 rep(i,n-1){
         sum+=a[i]*v[i];
         sum%=m;
 }
 cout<<sum<<endl;
}
 




Compiler output:
a.cc: In function 'int main()':
a.cc:86:2: error: expected '}' at end of input
   86 | }
      |  ^
a.cc:66:1: note: to match this '{'
   66 | {
      | ^
Language: Java

import java.util.Scanner;

public class Main2 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long a[] = new long[n];

        for (int i=0; i<n; i++){
            a[i] = sc.nextLong();
        }
        long sum = 0;
        for (int j=0; j<a.length-1; j++) {
            for (int k=j+1; k<a.length; k++) {
                if(j != k){
                    System.out.println(a[j]);
                    System.out.println(a[k]);
                    sum += (a[j]*a[k]);
                    System.out.println(sum);
                }
            }
        }

        System.out.println(sum%1000000007);
        sc.close();
    }
}

Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: C++

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

const int mx=2e6;

int main(){
	int n,i;
	long long int ans=0,sum=0,v;
	cin>>n;
	vector<int> arr(n);
	for(i=0;i<n;i++){
		cin>>arr[i];
		sum+=arr[i];
	}

	for(i=0;i<n;i++){
		sum-=arr[i];
		//v = sum%mod;
        sum = (sum+m)%mod;
		ans+=((sum[i]%mod)*(arr[i]%mod)+mod)%mod;
	}
	cout<<ans%mod<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'm' was not declared in this scope
   21 |         sum = (sum+m)%mod;
      |                    ^
a.cc:22:27: error: invalid types 'long long int[int]' for array subscript
   22 |                 ans+=((sum[i]%mod)*(arr[i]%mod)+mod)%mod;
      |                           ^
Language: C++

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

const int mx=2e6;

int main(){
	int n,i;
	long long int ans=0,sum=0,v;
	cin>>n;
	vector<int> arr(n);
	for(i=0;i<n;i++){
		cin>>arr[i];
		sum+=arr[i];
	}

	for(i=0;i<n;i++){
		sum-=arr[i];
		//v = sum%mod;
		ans+=((sum[i]%mod)*(arr[i]%mod)+mod)%mod;
	}
	cout<<ans%mod<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: invalid types 'long long int[int]' for array subscript
   21 |                 ans+=((sum[i]%mod)*(arr[i]%mod)+mod)%mod;
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int i,j;
  long long int64_t x=0,y=0,z=0;
  int N;
  cin >> N;
  vector<int64_t> A(N+1);
  for(i=1;i<=N;i++){
    cin >> A[i];
    y+=A[i];
  }
  
  for(i=1;i<=N;i++){
    z=(y-A[i])%1000000007;
    x+=A[i]*z;
  }
  
  x=x/2;
  x=x%1000000007;
  
  cout << x << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: expected initializer before 'x'
    5 |   long long int64_t x=0,y=0,z=0;
      |                     ^
a.cc:11:5: error: 'y' was not declared in this scope
   11 |     y+=A[i];
      |     ^
a.cc:15:5: error: 'z' was not declared in this scope
   15 |     z=(y-A[i])%1000000007;
      |     ^
a.cc:15:8: error: 'y' was not declared in this scope
   15 |     z=(y-A[i])%1000000007;
      |        ^
a.cc:16:5: error: 'x' was not declared in this scope
   16 |     x+=A[i]*z;
      |     ^
a.cc:19:3: error: 'x' was not declared in this scope
   19 |   x=x/2;
      |   ^
Language: C

#include<stdio.h>

#define MOD 10**9+7

int main(){
    int n;
    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    long long int sum=0;
    long long int initial=0;
    for(int i=0;i<n-1;i++){
        initial=a[i]%MOD;
        sum+=(initial%MOD)*(a[i]%MOD);
        sum%=MOD;
    }
    printf("%lld\n",sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:16: error: invalid type argument of unary '*' (have 'int')
    3 | #define MOD 10**9+7
      |                ^~
main.c:16:22: note: in expansion of macro 'MOD'
   16 |         initial=a[i]%MOD;
      |                      ^~~
main.c:3:16: error: invalid type argument of unary '*' (have 'int')
    3 | #define MOD 10**9+7
      |                ^~
main.c:17:23: note: in expansion of macro 'MOD'
   17 |         sum+=(initial%MOD)*(a[i]%MOD);
      |                       ^~~
main.c:3:16: error: invalid type argument of unary '*' (have 'int')
    3 | #define MOD 10**9+7
      |                ^~
main.c:17:34: note: in expansion of macro 'MOD'
   17 |         sum+=(initial%MOD)*(a[i]%MOD);
      |                                  ^~~
main.c:3:16: error: invalid type argument of unary '*' (have 'int')
    3 | #define MOD 10**9+7
      |                ^~
main.c:18:14: note: in expansion of macro 'MOD'
   18 |         sum%=MOD;
      |              ^~~
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new java.util.Scanner(System.in);
		long n = sc.nextLong();
      	long p = sc.nextLong();
      
      long ans = 0;
      
      for(int i = 0; i < n - 1;i++){
        long q = sc.nextLong();
        ans += (p * q) % 100000007;
        p = (p + q) % 100000007;
      }
      
      System.out.println(ans);
	}
}


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

int main(){
    int n;
    cin>>n;
    vector<long long> a(n);
    long long sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    vector<long long> ans;
    for(int i=0;i<n-1;i++){
        sum-=a[i];
    	long long temp =  a[i]*sum;
        temp %= (long long)1e9+7;
        ans.push_back(temp);
    }
    long long res=0;
    for(auto x:ans){
        res+=x;
        res%=(long long)1e9+7;
    }
    cout << res << endl;
    return 0;
}

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<long long> a(n);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'long'
    4 |     vector<long long> a(n);
      |            ^~~~
a.cc:7:14: error: 'a' was not declared in this scope
    7 |         cin>>a[i];
      |              ^
a.cc:10:12: error: expected primary-expression before 'long'
   10 |     vector<long long> ans;
      |            ^~~~
a.cc:12:14: error: 'a' was not declared in this scope
   12 |         sum-=a[i];
      |              ^
a.cc:15:9: error: 'ans' was not declared in this scope
   15 |         ans.push_back(temp);
      |         ^~~
a.cc:18:16: error: 'ans' was not declared in this scope
   18 |     for(auto x:ans){
      |                ^~~
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << res << endl;
      |     ^~~~
a.cc:22:20: error: 'endl' was not declared in this scope
   22 |     cout << res << endl;
      |                    ^~~~
Language: C++

  #pragma GCC optimize("Ofast")
  #pragma GCC target("avx,avx2,fma")
  #include <bits/stdc++.h>
  using namespace std;
  //---------------------------------//
  void __print(int x) {cerr << x;}
  void __print(long x) {cerr << x;}
  void __print(long long x) {cerr << x;}
  void __print(unsigned x) {cerr << x;}
  void __print(unsigned long x) {cerr << x;}
  void __print(unsigned long long x) {cerr << x;}
  void __print(float x) {cerr << x;}
  void __print(double x) {cerr << x;}
  void __print(long double x) {cerr << x;}
  void __print(char x) {cerr << '\'' << x << '\'';}
  void __print(const char *x) {cerr << '\"' << x << '\"';}
  void __print(const string &x) {cerr << '\"' << x << '\"';}
  void __print(bool x) {cerr << (x ? "true" : "false");}

  template<typename T, typename V>
  void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  template<typename T>
  void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  void _print() {cerr << "]\n";}
  template <typename T, typename... V>
  void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  #ifndef ONLINE_JUDGE
  #define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
  #else
  #define deb(x...)
  #endif
 //------------------------------//

  typedef long long int ll;
  typedef pair<int,int> pi;
  typedef pair<ll,ll> pll;
  typedef vector<int> vi;
  typedef vector<ll> vll;
  typedef vector<pi> vpi;
  typedef vector<pll> vpll;

  #define  ff           first
  #define  ss           second
  #define  pb           push_back
  #define  IOS          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define  all(x)       (x).begin(), (x).end()
  #define  ps(x,y)      fixed<<setprecision(y)<<x
  #define  rep(i,a,b)   for(ll i=a ; i<b ; ++i)

  const ll MOD = 1e9 + 7;
  const ll INF = 1e18;
  const ll maxn = 1e6 + 4;


  void solve(){
    int n;
    cin >> n;
    ll sum=0;
    ll ans=0;
    vll v(n);
    for(int i=0;i<n;i++){
      cin >> v[i];
      sum = (sum + v[i])%MOD;
    }
    for(int i=0;i<n;i++){
      ans = (ans+(((sum-v[i]+MOD)%MOD)*(v[i]))%MOD))%MOD;
      sum = (sum-v[i]+MOD)%MOD;
    }
    cout << ans;
  }

  int main(){
    IOS
    	solve();
    //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
  }

// integer overflow


Compiler output:
a.cc: In function 'void solve()':
a.cc:66:52: error: expected ';' before ')' token
   66 |       ans = (ans+(((sum-v[i]+MOD)%MOD)*(v[i]))%MOD))%MOD;
      |                                                    ^
      |                                                    ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<long long> a(n);
  long long sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  vector<long long> ans;
  for(int i=0;i<n-1;i++){
      sum-=a[i];
    　sum%=(long long)1e9+7;
      ans.push_back(a[i]*sum);
  }
  long long res=0;
  for(auto x:ans){
    res+=x;
    res%=(long long)1e9+7;
  }
  cout<<res<<endl;
  return 0;
}


Compiler output:
a.cc:15:5: error: extended character 　 is not valid in an identifier
   15 |     　sum%=(long long)1e9+7;
      |     ^
a.cc: In function 'int main()':
a.cc:15:5: error: '\U00003000sum' was not declared in this scope
   15 |     　sum%=(long long)1e9+7;
      |     ^~~~~
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>;
const int INF=1e9;

const int MOD=1e9+7;

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

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<long long> a(n);
  long long sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  vector<long long> ans;
  for(int i=0;i<n-1;i++){
      sum-=a[i];
    	long long temp =  (a[i]*sum)%1e9+7;
      ans.push_back(temp);
  }
  long long res=0;
  for(auto x:ans){
    res+=x;
    res%=(long long)1e9+7;
  }
  cout<<res<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   15 |         long long temp =  (a[i]*sum)%1e9+7;
      |                           ~~~~~~~~~~^~~~
      |                                |     |
      |                                |     double
      |                                __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<long long> a(n);
  long long sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  vector<long long> ans;
  for(int i=0;i<n-1;i++){
      sum-=a[i];
    	long long temp =  (a[i]*sum)%1e9+7
      ans.push_back(temp);
  }
  long long res=0;
  for(auto x:ans){
    res+=x;
    res%=(long long)1e9+7;
  }
  cout<<res<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   15 |         long long temp =  (a[i]*sum)%1e9+7
      |                           ~~~~~~~~~~^~~~
      |                                |     |
      |                                |     double
      |                                __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
Language: C++

n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
mod = 10**9+7
 
for i in range(n-1):
    s -= a[i]
    ans += a[i]*s
 
print(ans%mod)

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

#include <iostream>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
 int main() {
	ll n;
    cin>> n;
    ll a(n);
    ll ans = 0;
    ll sum = 0;
    rep(i,n){
        cin>> a[i];
        sum +=(a[i]*sum);
        ans %= MOD;
    }
    cout<<ans;}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: invalid types 'll {aka long long int}[int]' for array subscript
   13 |         cin>> a[i];
      |                ^
a.cc:14:17: error: invalid types 'll {aka long long int}[int]' for array subscript
   14 |         sum +=(a[i]*sum);
      |                 ^
a.cc:15:16: error: 'MOD' was not declared in this scope
   15 |         ans %= MOD;
      |                ^~~
Language: Java

import java.util.*;
class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
  long po=new long[n];
  long sum=0;
  long a[]=new long[n];
  for(int i=0;i<n;i++){
  	po[i]=sc.nextLong();
    a[i]=(i==0)?po[0]:a[i-1]+po[i];
    sum+=po[i];
  }
  long ans=0;
  for(int i=0;i<n;i++){
  	ans+=po[i]*sum-po[i];
    ans%=1000000007;
  }System.out.println(ans);
  
}
}

Compiler output:
Main.java:6: error: incompatible types: long[] cannot be converted to long
  long po=new long[n];
          ^
Main.java:10: error: array required, but long found
  	po[i]=sc.nextLong();
  	  ^
Main.java:11: error: array required, but long found
    a[i]=(i==0)?po[0]:a[i-1]+po[i];
                  ^
Main.java:11: error: array required, but long found
    a[i]=(i==0)?po[0]:a[i-1]+po[i];
                               ^
Main.java:12: error: array required, but long found
    sum+=po[i];
           ^
Main.java:16: error: array required, but long found
  	ans+=po[i]*sum-po[i];
  	       ^
Main.java:16: error: array required, but long found
  	ans+=po[i]*sum-po[i];
  	                 ^
7 errors
Language: Java

import java.util.*;
class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
      	int N = sc.nextInt();
        int[] A = new int[N];
        int sum = 0;
      
      for (int i = 0; i < N-2; i++){
      	
        for (int j = i+1; j < N-1; J++){
      		sum += A[i] * A[j];
        }
      }
      System.out.println(sum % (10^9+7));
		    }
 }


Compiler output:
Main.java:11: error: cannot find symbol
        for (int j = i+1; j < N-1; J++){
                                   ^
  symbol:   variable J
  location: class Main
1 error
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int num = Integer.parseInt(line);
        line = sc.nextLine();
        String[] lines = line.split(" ", 0);
        long[] array = new long[num];
        long ret = 0;
 
        for (int i = 0; i < num; i++) {
            array[i] = Long.parseLong(lines[i]);
        }
        
        long[] array2 = new long[num];
        long sum = 0;
        for (int i = 1; i < num; i++) {
            sum += array[i];
            if (sum >= 1000000007) {
                sum = sum % 1000000007;
            }
        }
        array2[0] = sum;
        for (int i = 1; i < num ; i++){
            array2[i] = array2[i - 1] - array[i];
          if (array2[i] < 0) {
            array2[i] += 1000000007;
          }
        }
        
        for (int i = 0; i < num; i++) {
            ret += (array[i] * array2[i]);
            if (ret >= 1000000007) {
                ret = ret % 1000000007;
            }
        }
 
        System.out.println(ret);
    }

Compiler output:
Main.java:41: error: reached end of file while parsing
    }
     ^
1 error
Language: C

#include <stdio.h>
 
int main()
{
  unsigned long n;
  scanf("%lu",&n);
  unsigned long a[n];
  int i;
  i = 0;
  unsigned long sum = 0;
  unsigned long p = 0;
  while (i < n)
  {
    scanf("%lu",&a[i]);
    if (i != 0)
    {
        p += a[i - 1];
      	p %= 1000000000 + 7
    	sum += a[i]*p;
      	if(sum >= 1000000000 + 7)
         sum %= 1000000000 + 7;
    }
    i++;
  }
  printf("%lu",sum % (1000000000 + 7));
}

Compiler output:
main.c: In function 'main':
main.c:18:28: error: expected ';' before 'sum'
   18 |         p %= 1000000000 + 7
      |                            ^
      |                            ;
   19 |         sum += a[i]*p;
      |         ~~~
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>;

const long mod = 1000000007L

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

    ll a[n+10];
    ll sum = 0;
    rep (i, n) {
        cin >> a[i];
        sum += a[i];
        sum %= mod;
    }

    ll ans = 0;

    for (int i = 0; i < n; i++) {
        sum -= a[i];
        sum %= mod;
        ans += a[i] * sum;
        ans %= mod;
    }
    
    if (ans < 0) cout << ans + mod << endl;
    else cout << ans % mod << endl;
    return 0;
    
    
}

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

#include <bits/stdc++.h>
using namespace std;
// typedef
using ll  = long long;
using str = string;
using PL  = pair<ll, ll>;
using P   = pair<int, int>;
using VL  = vector<ll>;
using VI  = vector<int>;
using VS  = vector<str>;
using VP  = vector<P>;
using VPL = vector<PL>;
using VVL = vector<VL>;
using VVI = vector<VI>;

// const num
const ll INF         = 1e18 + 18;
const ll MAX         = 100005;
const ll MOD         = 1000000007;
const long double PI = acosl(-1.0);

// loop
#define REP(i, a, b) for(ll(i) = (a); (i) < (b); (i)++)
#define RREP(i, a, b) for(ll(i) = (a); (i) >= (b); (i)--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, n, 0)

// YesNo
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
// All
#define ALL(v) v.begin(), v.end()
#define deduplicate(v) (v).erase(unique(ALL(d)), (v).end())

int main(void) {
	int n;
	cin >> n;
	VL a(n);
	VL sum(n + 1, 0);
	ll ans = 0;
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, n) {
		sum[i + 1] = sum[i] + a[i];
	}
	rep(i, n) {
		ll intvsum = (sum[n] - sum[i + 1]) % MOD;
		ll ans += a[i] * intvsum;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: expected initializer before '+=' token
   49 |                 ll ans += a[i] * intvsum;
      |                        ^~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<bitset>
#include<queue>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;

int main(){
  int n;
  cin >> n;
  vector<ll> vec(n);
  ll sum = 0;
  ll mod = 1e7;
  rep(i,n){
    cin >> vec.at(i);
    sum += vec.at(i);
    sum %= mod;
  }
  ll ans;
  for (int i=0; i<n-1; i++){
    sum -= vec.at(i);
    x += vec.at(i) * sum % mod;
  }
  cout << x % mod << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'x' was not declared in this scope
   29 |     x += vec.at(i) * sum % mod;
      |     ^
a.cc:31:11: error: 'x' was not declared in this scope
   31 |   cout << x % mod << endl;
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
 
int main(){
  int N, A;
  int sum, waru, sqsum, ans;
  N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
  cin >> N;
  for(int i = 0; i<N; i++){
    cin >> A;
    sum += A;
    sum = (sum + waru) % waru;
    sqsum += pow(A,2);
    sqsum  = (sqsum + waru )% waru;
  }
  ans = ((pow(sum,2)-sqsum) + waru) % waru;
  ans *= 0.5;
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:37: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   18 |   ans = ((pow(sum,2)-sqsum) + waru) % waru;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
      |                             |         |
      |                             |         int
      |                             __gnu_cxx::__promote<double>::__type {aka double}
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int num = Integer.parseInt(line);
        line = sc.nextLine();
        String[] lines = line.split(" ", 0);
        long[] array = new long[num];
        long ret = 0;
 
        for (int i = 0; i < num; i++) {
            array[i] = Long.parseLong(lines[i]);
        }
        
        long[] array2 = new long[num];
        long sum = 0;
        for (int i = 1; i < num; i++) {
            sum += array[i];
            if (sum >= 1000000007) {
                sum = sum % 1000000007;
            }
        }
        array2[0] = sum;
        for (int i = 1; i < num ; i++){
            array2[i] = array2[i - 1] - array[i];
          if (arrays2[i] < 0) {
            array2[i] += 1000000007;
          }
        }
        
        for (int i = 0; i < num; i++) {
            ret += (array[i] * array2[i]);
            if (ret >= 1000000007) {
                ret = ret % 1000000007;
            }
        }
 
        System.out.println(ret);
    }
 

Compiler output:
Main.java:41: error: reached end of file while parsing
    }
     ^
1 error
Language: C

#include<stdio.h>
#define max(a,b) ((a)>(b)?(a):(b))
typedef long long int ll;
#define MOD 1000000007
int main() {
    int n;
    scanf("%d",&n);
    long a[200000];
    long aa[200000]={0};
    long ans=0;
  	for (int i=0;i<n;i++) {
        scanf("%ld",&a[i]);
        if(i==0) aa[i]=a[i]%MOD;
        else aa[i]=(aa[i-1]+a[i])%MOD;
    }
    for (int i=0;i<n-1;i++) {
        ans=(ans+(a[i]*(aa[n]-aa[i])MOD)MOD;
    }
    printf("%ld",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:37: error: expected ')' before numeric constant
   17 |         ans=(ans+(a[i]*(aa[n]-aa[i])MOD)MOD;
      |                  ~                  ^
      |                                     )
main.c:17:41: error: expected ')' before numeric constant
   17 |         ans=(ans+(a[i]*(aa[n]-aa[i])MOD)MOD;
      |             ~                           ^
      |                                         )
main.c:17:45: error: expected ';' before '}' token
   17 |         ans=(ans+(a[i]*(aa[n]-aa[i])MOD)MOD;
      |                                             ^
      |                                             ;
   18 |     }
      |     ~
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int num = Integer.parseInt(line);
        line = sc.nextLine();
        String[] lines = line.split(" ", 0);
        long[] array = new long[num];
        long ret = 0;
 
        for (int i = 0; i < num; i++) {
            array[i] = Long.parseLong(lines[i]);
        }
        
        long[] array2 = new long[num];
        long sum = 0;
        for (int i = 1; i < num; i++) {
            sum += array[i];
            if (sum >= 1000000007) {
                sum = sum % 1000000007;
            }
        }
        array2[0] = sum;
        for (int i = 1; i < num ; i++){
            array2[i] = array2[i - 1] - array[i];
          if (arrays2[i] < 0) {
            array2 += 1000000007;
          }
        }
        
        for (int i = 0; i < num; i++) {
            ret += (array[i] * array2[i]);
            if (ret >= 1000000007) {
                ret = ret % 1000000007;
            }
        }
 
        System.out.println(ret);
    }
 
}

Compiler output:
Main.java:28: error: cannot find symbol
          if (arrays2[i] < 0) {
              ^
  symbol:   variable arrays2
  location: class Main
Main.java:29: error: bad operand types for binary operator '+'
            array2 += 1000000007;
                   ^
  first type:  long[]
  second type: int
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
 
int main(){
  int N, A;
  int sum, waru, sqsum, ans;
  N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
  cin >> N;
  for(int i = 0; i<N; i++){
    cin >> A;
    sum += A;
    sum = (sum + waru) % waru;
    sqsum += pow(A,2);
    sqsum  = (sqsum + waru )% waru;
  }
  ans = (pow(sum,2)-sqsum) + waru) % waru;
  ans *= 0.5;
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:34: error: expected ';' before ')' token
   18 |   ans = (pow(sum,2)-sqsum) + waru) % waru;
      |                                  ^
      |                                  ;
Language: C

main(){
 long int k,i,n;
  scanf("%ld",&n);
  long long int a[n],b[n],l=0,s=0,m=1000000000+7;
  for(i=0;i<n;i++){scanf("%lld",&a[i]);l=(l+a[i])%m;b[i]=l;}
 for(k=0;k<n;k++){s+=a[k]*(b[n-1]-b[k]);s=s%m;}
  if(s>0)printf("%lld",s);
 else printf("%lld",s+m)
}


Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%ld",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%ld",&n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:10: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |   if(s>0)printf("%lld",s);
      |          ^~~~~~
main.c:7:10: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:10: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:10: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    8 |  else printf("%lld",s+m)
      |       ^~~~~~
main.c:8:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:25: error: expected ';' before '}' token
    8 |  else printf("%lld",s+m)
      |                         ^
      |                         ;
    9 | }
      | ~
Language: C++

//om namah shivaaay//
#include <bits/stdc++.h>
#define input int t;cin>>t;while(t--)
#define Om_namah_Shivaay ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL),cout.precision(10)
 #define ll long long
#define mod 1000000007
 using namespace std;
 int main()
 {
    Om_namah_Shivaay;
    ll n,sum=0;
    scanf("%ll64d", &n);
    ll a[n];
    for(ll i=0;i<n;i++){
      scanf("%llld", &a[i]);
 }
 for(ll i=0;i<n-1;i++)
       {
		   for(ll j=1;j<n;j++)
		   {
			  sum+=a[i]*a[j];

		   }}
		  
		   			printf("%lld",sum%M);
		   			}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:59: error: 'M' was not declared in this scope
   25 |                                         printf("%lld",sum%M);
      |                                                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define re return
#define ll long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rept(i,a,b) for(int i=a;i<=b;i++)
const int maxn=1e9+7;
ll n;
vector <ll> v(n);
int main(){
	cin>>n;
	ll all=0,ans=0;
	rep(i,0,n)cin>>v[i];
	rep(i,0,n){
		all+=v[i];
		all%=maxn;
	}
	ll ans=0;
	rep(i,0,n){
		all=all-v[i];
		ans+=a[i]*all,ans%=maxn;
	}
	cout<<ans<<endl;
	re 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: redeclaration of 'long long int ans'
   18 |         ll ans=0;
      |            ^~~
a.cc:12:18: note: 'long long int ans' previously declared here
   12 |         ll all=0,ans=0;
      |                  ^~~
a.cc:21:22: error: 'a' was not declared in this scope
   21 |                 ans+=a[i]*all,ans%=maxn;
      |                      ^
Language: C++

n = int(input())
a = list(map(int, input().split()))
s = 0
ans = 0
for i in range(len(a)):
  s += a[i]
for i in range(len(a)-1):
  s -= a[i]
  if s<0:
	s += 1e9+7
  ans += s*a[i]
  ans %= 1e9+7
print(int(ans))

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

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

int main()
{
    ios_base::sync_with_stdio(false);
    lli n;
    cin >> n;

    vector<lli> v(n);
    lli total_sum = 0;

    for(lli i = 0; i < n; i++)
    {
        cin >> v[i];
        total_sum += v[i];
    }

    lli current_sum = 0;
    lli answer = 0;

    for(int i = 0; i < n; i++)
    {
        current_sum += v[i];
        current_sum = current_sum
        lli factor = total_sum - current_sum;
        factor = factor%(1000000000 + 7);

        answer += v[i]*factor;
        answer = answer%(1000000000 + 7);

    }

    cout << answer << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: expected ';' before 'lli'
   26 |         current_sum = current_sum
      |                                  ^
      |                                  ;
   27 |         lli factor = total_sum - current_sum;
      |         ~~~                       
a.cc:28:9: error: 'factor' was not declared in this scope
   28 |         factor = factor%(1000000000 + 7);
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define _GLIBCXX_DEBUG
#define int long long
using namespace std;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MAXIN(x) max_element(ALL(x)) - x.begin();
#define MIN(x) *min_element(ALL(x))
#define MININ(x) min_element(ALL(x)) - x.begin();
#define INF 1000000000000
#define MOD 1000000007

#define MAXR 100000
#define PI 3.14159265358979323846

using namespace std;

signed main()
{
    int n;
    cin >> n;
    vector<int> A(n);
    int sum = 0;
    int ans = 0;
    REP(i, n){
        cin >> A[i];
        sum += A[i];
        sum %= mod;
    }
    //cout << sum <<endl ;

    REP(i,n-1){
        sum -= A[i];
        int a = A[i]%MOD * sum%MOD;
        if (sum < 0) sum += MOD;
        //cout <<"a"<<a   <<endl ;
      //  a = a % MOD;
        ans += a;
        ans = ans % MOD;
    }

    cout << ans <<endl ;



    return 0;
}

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

#include<iostream>
using namespace std;
const long int pMod = 1000000007;

int main() {
  int n;
  cin >> n;
  long long int a[n], tempsum = 0, sum = 0;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] %= pMod;
    tempsum += a[i];
  }
  for(int i = 0; i < n; i++) {
    tempsum -= a[i];
    sum += tempsum * a[i]
    sum = sum % pMod;
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: expected ';' before 'sum'
   16 |     sum += tempsum * a[i]
      |                          ^
      |                          ;
   17 |     sum = sum % pMod;
      |     ~~~
Language: C++

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
 
int main(){
  long long N, A;
  long long sum, waru, sqsum, ans;
  N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
  cin >> N;
  for(int i = 0; i<N; i++){
    cin >> A;
    sum += A;
    sum = fmod(sum, waru);
    sqsum += pow(A,2);
    sqsum  = fmod(sqsum, waru)
  }
  ans = fmod((pow(sum,2)-sqsum),waru)*0.5;
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before '}' token
   16 |     sqsum  = fmod(sqsum, waru)
      |                               ^
      |                               ;
   17 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
  long long N, A;
  long long sum, waru, sqsum, ans;
  N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
  cin >> N;
  for(int i = 0; i<N; i++){
    cin >> A;
    sum += A;
    sum = fmod(sum, waru);
    sqsum += pow(A,2);
    sqsum  = fmod(sqsum, waru)
  }
  ans = fmod((pow(sum,2)-sqsum),waru)*0.5;
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:53: error: 'pow' was not declared in this scope
    8 |   N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
      |                                                     ^~~
a.cc:13:11: error: 'fmod' was not declared in this scope
   13 |     sum = fmod(sum, waru);
      |           ^~~~
a.cc:17:9: error: 'fmod' was not declared in this scope
   17 |   ans = fmod((pow(sum,2)-sqsum),waru)*0.5;
      |         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(){
    int n;
    long long sum = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        long num;
        cin >> num;
        v.push_back(num);
    }

    for (int i = 0; i < v.size() - 1; i++)
    {

        for (int j = i + 1; j < v.size(); j++)
        {
            sum += v[i] * v[j];
            if (1000000007 < sum)
            {
                sum = sum % 1000000007;
            }
        }
    }

    cout << sum << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'v' was not declared in this scope
   20 |         v.push_back(num);
      |         ^
a.cc:23:25: error: 'v' was not declared in this scope
   23 |     for (int i = 0; i < v.size() - 1; i++)
      |                         ^
Language: C++

int main(){
  long long N, A;
  long long sum, waru, sqsum, ans;
  N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
  cin >> N;
  for(int i = 0; i<N; i++){
    cin >> A;
    sum += A;
    sum = fmod(sum, waru);
    sqsum += pow(A,2);
    sqsum  = fmod(sqsum, waru)
  }
  ans = fmod((pow(sum,2)-sqsum),waru)*0.5;
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:53: error: 'pow' was not declared in this scope
    4 |   N = 0; A = 0; sum = 0; ans = 0; sqsum = 0; waru = pow(10,9) + 7;
      |                                                     ^~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> N;
      |   ^~~
a.cc:9:11: error: 'fmod' was not declared in this scope
    9 |     sum = fmod(sum, waru);
      |           ^~~~
a.cc:13:9: error: 'fmod' was not declared in this scope
   13 |   ans = fmod((pow(sum,2)-sqsum),waru)*0.5;
      |         ^~~~
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout << ans;
      |   ^~~~
Language: C++

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

int main()
{
    ios_base::sync_with_stdio(false);
    lli n;
    cin >> n;

    vector<lli> v(n);
    lli total_sum = 0;

    for(lli i = 0; i < n; i++)
    {
        cin >> v[i];
        total_sum += v[i];
    }

    lli current_sum = 0;
    lli answer = 0;

    for(int i = 0; i < n; i++)
    {
        current_sum += v[i];
        current_sum = current_sum%(1000000000 + 7);
        lli factor = total_sum - current_sum;

        answer += v[i]*factor;
        answer = answer%(1000000000 + 7);

    }

    cout << answer << endl;

}

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

int main()
{
    ios_base::sync_with_stdio(false);
    lli n;
    cin >> n;

    vector<lli> v(n);
    lli total_sum = 0;

    for(lli i = 0; i < n; i++)
    {
        cin >> v[i];
        total_sum += v[i];
    }

    lli current_sum = 0;
    lli answer = 0;

    for(int i = 0; i < n; i++)
    {
        current_sum += v[i];
        current_sum = current_sum%(1000000000 + 7);
        lli factor = total_sum - current_sum;

        answer += v[i]*factor;
        answer = answer%(1000000000 + 7);

    }

    cout << answer << endl;

}



Compiler output:
a.cc:42:5: error: redefinition of 'int main()'
   42 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
#define int long long int
int32_t main() {
    
    int n;
    cin>>n;
    int a[n];
    int x=1000000007;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
      // s+=a[i];
   }
  // s=s*s;
    int sum[n],s=0;
    for(int i=n-1;i>=0;i--)
    {
      s=s+a[i];
      sum[i]=s;
      
      //sum=sum+(a[i]*a[i]);
        //sum[i]=s;
    }
  int ss=0,si=0;
  for(int i=0;i<=n-2;i++)
    {
      si=((a[i]%x)*(sum[i+1]%x))%x;
      ss=ss%x+si%x
      //sum=sum+(a[i]*a[i]);
        //sum[i]=s;
    }
    ss=ss%x;
    
    cout<<ss;
    
    return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:30:19: error: expected ';' before '}' token
   30 |       ss=ss%x+si%x
      |                   ^
      |                   ;
......
   33 |     }
      |     ~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

void funcA() {

  double d, t, s;
  cin >> d >> t >> s;

  double time = d / s;

  if (time <= t) cout << "Yes";
  else cout << "No";
}

void funcB() {

  string s, t;
  cin >> s >> t;

  int ans = 10000;
  for (int i = 0; i < s.size() - t.size() + 1; ++i) {
    int count = 0;

    for (int j = 0; j < t.size(); ++j) {
      if (s[i + j] != t[j]) ++count;
    }
    if (count < ans) ans = count;
  }

  cout << ans;
}

void funcC() {

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

  long long ans = 0;
  long long sum = a[0];
  int num = 2;
  for (int i = 0; i < a.size() - 1; ++i) {
    ans += sum * a[i + 1];
    ans %= long long(pow(10, 9));
    sum += a[i + 1];
    sum %= long long(pow(10, 9));
  }

  cout << ans;

}

/*
void funcD() {

  int n, m;
  cin >> n >> m;
  int group = 1;

  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
  }




}*/

int main() {

  //funcA();
  funcC();

  //funcD();

  return 0;
}

Compiler output:
a.cc: In function 'void funcC()':
a.cc:49:12: error: expected primary-expression before 'long'
   49 |     ans %= long long(pow(10, 9));
      |            ^~~~
a.cc:51:12: error: expected primary-expression before 'long'
   51 |     sum %= long long(pow(10, 9));
      |            ^~~~
Language: C++

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

 int main(){
   int n, i,j;
  long long x=;
  int k= (1e+9)+7;
   cin >> n;
   vector<int> a(n);
   for(i = 0; i < n; i++){
     cin >> a[i];
   }
   
   for(i = 0; i < n-1;i++){
     for ( j = i+1; j < n; j++){
         x += a[i]*a[j];
     }
   }
   long long ans = x%k;
   cout << ans << endl;
   
   
     return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before ';' token
    6 |   long long x=;
      |               ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

void funcA() {

  double d, t, s;
  cin >> d >> t >> s;

  double time = d / s;

  if (time <= t) cout << "Yes";
  else cout << "No";
}

void funcB() {

  string s, t;
  cin >> s >> t;

  int ans = 10000;
  for (int i = 0; i < s.size() - t.size() + 1; ++i) {
    int count = 0;

    for (int j = 0; j < t.size(); ++j) {
      if (s[i + j] != t[j]) ++count;
    }
    if (count < ans) ans = count;
  }

  cout << ans;
}

void funcC() {

  int n;
  cin >> n;
  vector<unsigned long long> a;
  for (int i = 0; i < n; ++i) {
    unsigned long long temp;
    cin >> temp;
    //nより大きい整数は間引き
    a.push_back(temp);
  }

  unsigned long long ans = 0;
  unsigned long long sum = a[0];
  int num = 2;
  for (int i = 0; i < a.size() - 1; ++i) {
    ans += sum * a[i + 1];
    ans %= unsigned long long(pow(10, 9));
    sum += a[i + 1];
    sum %= unsigned long long(pow(10, 9));
  }

  cout << ans;

}

/*
void funcD() {

  int n, m;
  cin >> n >> m;
  int group = 1;

  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
  }




}*/

int main() {

  //funcA();
  funcC();

  //funcD();

  return 0;
}

Compiler output:
a.cc: In function 'void funcC()':
a.cc:54:12: error: expected primary-expression before 'unsigned'
   54 |     ans %= unsigned long long(pow(10, 9));
      |            ^~~~~~~~
a.cc:56:12: error: expected primary-expression before 'unsigned'
   56 |     sum %= unsigned long long(pow(10, 9));
      |            ^~~~~~~~
Language: C


#include <stdio.h>
#include <math.h>

int main()
{int n;scanf("%d",&n);long long int a[n],j;for(j=0;j<n;j++)scanf("%lld",(a+j));
long long int s=0,d=0,p=1000000007;for(j=0;j<n;j++){s=((s+a[j])%p);d=((d+((a[j]*a[j])%p))%p);}
s=((s*s)%p);
printf("%lld\n",((s-d)/2));
return(0);

Compiler output:
main.c: In function 'main':
main.c:10:1: error: expected declaration or statement at end of input
   10 | return(0);
      | ^~~~~~
Language: C++

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

 int main(){
   int n, i,j;
  long long x=0
  int k= (1e+9)+7;
   cin >> n;
   vector<int> a(n);
   for(i = 0; i < n; i++){
     cin >> a[i];
   }
   
   for(i = 0; i < n-1;i++){
     for ( j = i+1; j < n; j++){
         x += a[i]*a[j];
     }
   }
   long long ans = x%k;
   cout << ans << endl;
   
   
     return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int k= (1e+9)+7;
      |   ^~~
a.cc:19:22: error: 'k' was not declared in this scope
   19 |    long long ans = x%k;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int A;
  cin >> N >>;
 
  i=0
    
  while(i<=N)
    cin >> 
 
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected primary-expression before ';' token
    7 |   cin >> N >>;
      |              ^
a.cc:9:3: error: 'i' was not declared in this scope
    9 |   i=0
      |   ^
a.cc:12:11: error: expected '}' at end of input
   12 |     cin >>
      |           ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^