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

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

return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'res' was not declared in this scope
   11 |   sum+=res;}
      |        ^~~
Language: C++

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected '}' at end of input
   19 |         cout<<sum%1000000007;
      |                              ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

Compiler output:
cc1plus: error: '::main' must return 'int'
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 sum = 0;
    
    for (int i = 0; i < N; i++) {
      long A = sc.nextLong();
    }
    for (int j = i; j < N; j++) {
      long B = A[i] * A[j];
      long sum += B;
    }
    
    System.out.println(sum % 1000000007);
  }
}


Compiler output:
Main.java:14: error: ';' expected
      long sum += B;
              ^
Main.java:14: error: not a statement
      long sum += B;
                  ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mpp make_pair
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    fast;
    ll n,esq=0,sumsq=0,mod=1000000007;
    vector<ll>v;
    cin>>n;
    for(ll i=0; i<n; i++)
    {
        ll x;
        cin>>x;
        v.pb(x);
    }
    for(ll i=0; i<n; i++)
    {
       // v[i]=(v[i]+mod)%mod;
        sumsq+=(v[i]+mod)%mod;
        sumsq=(sumsq+mod)%mod;
        ll sq=(((v[i]%mod)*(v[i]%mod))+mod)%mod;
        esq+=(sq+mod)%mod;
        esq=(esq+mod)%mod;
    }
    sumsq=(sumsq+mod)%mod;
    sumsq=((((sumsq*sumsq)+mod)%mod)+mod)%mod;
    ll ans=(((((sumsq-esq)+mod)%mod)/2)+mod)%mod;
    cout<<ans<<endl;

}
//4
141421356 17320508 22360679 244949



Compiler output:
a.cc:35:1: error: expected unqualified-id before numeric constant
   35 | 141421356 17320508 22360679 244949
      | ^~~~~~~~~
Language: C++


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

int main(){
    int n;
    cin>>n;
    int a[n];
    unsigned 4long long int m=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            //m=((m%1000000007)+((a[i]*a[j])%1000000007))%1000000007;
            m=m+(a[i]*a[j]);
        }
    }
    cout<<(m%(1000000007));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected unqualified-id before numeric constant
    9 |     unsigned 4long long int m=0;
      |              ^~~~~
a.cc:16:13: error: 'm' was not declared in this scope
   16 |             m=m+(a[i]*a[j]);
      |             ^
a.cc:19:12: error: 'm' was not declared in this scope
   19 |     cout<<(m%(1000000007));
      |            ^
Language: C++

#include<iostream>
using namespace std;
#include<math.h>
int main()
{
    int n;
    cin>>n;
    long int sum = 0;
    long int *a = new long int[n];
    for(int i =0;i<n;i++)
        cin>>a[i];

    for(int i =0;i<n-1;i++)
    {
        for(int j = i+1;j<n;j++)
        {
            sum+=a[i]*a[j];
        }
    }
    sum = sum%(pow(10,9)+7);
    cout<<sum;
return 0;
}


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

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


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

#include <bits/stdc++.h>

using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n],i;
	long long int sum=0;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(i=0;i<n;i++)
	{
		int j;
		for(j=i+1;j<n;j++)
		sum=sum+a[i]*a[j];
	}
	cout<<sum;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
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 sum = 0;
    
    for (int i = 0; i < N; i++) {
      long A = sc.nextLong();
    }
    for (int j = i; j < N; j++) {
      long B = A[i] * A[j];
      long sum += B;
    }
    
    System.out.println(sum % 1000000007)
  }
}

Compiler output:
Main.java:14: error: ';' expected
      long sum += B;
              ^
Main.java:14: error: not a statement
      long sum += B;
                  ^
Main.java:17: error: ';' expected
    System.out.println(sum % 1000000007)
                                        ^
3 errors
Language: Java

import java.util.Scanner;

public class Main2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		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() % 1000000000L;
		}

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

		result = result % 1000000007L;
		System.out.println(result);

		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 <stdio.h>
# include <string.h>
# include <algorithm>
# define mod 1E9 + 7
using namespace std;

long long a[100100];
long long h, n;

int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", a + i);
    h += a[i];
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    h -= a[i];
    ans = (ans + ((h) % mod * a[i]) % mod) % mod;
  }
  printf("%lld\n", ans);
}

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

int n;
std::string s;
std::cin >> n;
std::cin >> s;
std::istringstream iss(s); 
std::vector<std::string> p { 
    std::istream_iterator<std::string>(iss), {} 
};
 
long product = 0;
for (int i = 0; i < n; i++) {
    for (int j = i; j <= n; j++) {
      long a = p[i];
      long b = p[j];
       product += a*b
    }
}
(product % (10**9 + 7)) >> cout

Compiler output:
a.cc:2:6: error: 'string' in namespace 'std' does not name a type
    2 | std::string s;
      |      ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | int n;
a.cc:3:6: error: 'cin' in namespace 'std' does not name a type
    3 | std::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 | int n;
a.cc:4:6: error: 'cin' in namespace 'std' does not name a type
    4 | std::cin >> s;
      |      ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | std::cin >> s;
      | ^~~
a.cc:5:6: error: 'istringstream' in namespace 'std' does not name a type
    5 | std::istringstream iss(s);
      |      ^~~~~~~~~~~~~
a.cc:1:1: note: 'std::istringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>'
  +++ |+#include <sstream>
    1 | int n;
a.cc:6:6: error: 'vector' in namespace 'std' does not name a template type
    6 | std::vector<std::string> p {
      |      ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | int n;
a.cc:11:1: error: expected unqualified-id before 'for'
   11 | for (int i = 0; i < n; i++) {
      | ^~~
a.cc:11:17: error: 'i' does not name a type
   11 | for (int i = 0; i < n; i++) {
      |                 ^
a.cc:11:24: error: 'i' does not name a type
   11 | for (int i = 0; i < n; i++) {
      |                        ^
a.cc:18:9: error: expected ')' before '%' token
   18 | (product % (10**9 + 7)) >> cout
      | ~       ^~
      |         )
Language: C++

#include <iostream>

using namespace std;
int main() {
	int N = 0;
	__int64 ans;
	cin >> N;
	__int64 A[N];
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	__int64 c = 0;
	for (int i = N - 1; i >= 0; i--) { //iは配列の番号
		c += A[i];
		ans += (c % 1000000007 * A[i - 1] % 1000000007) % 1000000007;
	}
	cout << ans % 1000000007 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    6 |         __int64 ans;
      |         ^~~~~~~
      |         __int64_t
a.cc:8:16: error: expected ';' before 'A'
    8 |         __int64 A[N];
      |                ^~
      |                ;
a.cc:10:24: error: 'A' was not declared in this scope
   10 |                 cin >> A[i];
      |                        ^
a.cc:12:16: error: expected ';' before 'c'
   12 |         __int64 c = 0;
      |                ^~
      |                ;
a.cc:14:17: error: 'c' was not declared in this scope
   14 |                 c += A[i];
      |                 ^
a.cc:14:22: error: 'A' was not declared in this scope
   14 |                 c += A[i];
      |                      ^
a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                 ans += (c % 1000000007 * A[i - 1] % 1000000007) % 1000000007;
      |                 ^~~
      |                 abs
a.cc:17:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         cout << ans % 1000000007 << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod (ll)(1e9+7)

int main()
{
	// added the two lines below
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, sum = 0;
	cin >> n;
	int a[n];
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (ll i = 0; i  < n-1; i++) {
		for (ll j = i + 1; j < n; j++) {
			sum = (sum + (a[i] * a[j]))%m;
		}
	}
	cout << (sum ) % mod << "\n";
	return 0;
}

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

#include<iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else { return gcd(b, a % b); } }
ll mod(ll a) { return a % 1000000007; }

int main() {
	ll n;
	cin >> n;
	vector<ll> A(n);
	for (int i = 0; i < n; i++) cin >> A[i];
	ll sum = 0;
	for (int i = 0; i < n; i++) sum = mod(sum + A[i]);
	ll ans = 0;
	for (int i = 0; i < n - 1; i++) {
		ans = mod(ans + A[i] * mod(sum-A[i]));
		sum = mod(sum - A[i]);
	}
	cout << ans;
	return 0;

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

int n;
std::string s;
std::cin >> n;
std::cin >> s;
std::istringstream iss(s); 
std::vector<std::string> p { 
    std::istream_iterator<std::string>(iss), {} 
};

long product = 0;
for (int i = 0; i < n; i++) {
    for (int j = i; j <= n; j++) {
      long a = p[i];
      long b = p[j];
        product += a*b
    }
}
(product % (10**9 + 7)) >> cout
rl.close()

Compiler output:
a.cc:2:6: error: 'string' in namespace 'std' does not name a type
    2 | std::string s;
      |      ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | int n;
a.cc:3:6: error: 'cin' in namespace 'std' does not name a type
    3 | std::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 | int n;
a.cc:4:6: error: 'cin' in namespace 'std' does not name a type
    4 | std::cin >> s;
      |      ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | std::cin >> s;
      | ^~~
a.cc:5:6: error: 'istringstream' in namespace 'std' does not name a type
    5 | std::istringstream iss(s);
      |      ^~~~~~~~~~~~~
a.cc:1:1: note: 'std::istringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>'
  +++ |+#include <sstream>
    1 | int n;
a.cc:6:6: error: 'vector' in namespace 'std' does not name a template type
    6 | std::vector<std::string> p {
      |      ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | int n;
a.cc:11:1: error: expected unqualified-id before 'for'
   11 | for (int i = 0; i < n; i++) {
      | ^~~
a.cc:11:17: error: 'i' does not name a type
   11 | for (int i = 0; i < n; i++) {
      |                 ^
a.cc:11:24: error: 'i' does not name a type
   11 | for (int i = 0; i < n; i++) {
      |                        ^
a.cc:18:9: error: expected ')' before '%' token
   18 | (product % (10**9 + 7)) >> cout
      | ~       ^~
      |         )
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:20: error: expected ';' before 'printf'
   14 |   sum %= 1000000007
      |                    ^
      |                    ;
   15 |   printf("%d",sum);
      |   ~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    long long sum = 0;
    /*N個の整数 A1,…,AN が与えられます。1≤i<j≤N を満たす
    全ての組 (i,j) についての Ai×Aj の和を mod(10**9+7)
     で求めてください。*/
    int n;
    cin >> n;
    long long a[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            sum += a[i] * a[j];
        }
    }
    cout << sum % (10 ** 9 + 7) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: invalid type argument of unary '*' (have 'int')
   20 |     cout << sum % (10 ** 9 + 7) << endl;
      |                        ^~~
Language: C++

#include<bIts/stdc++.h>
using namespace std;
int main()
{
    long long int n,a[2000005];
    cin>>n;
    for(long long int i=1;i<=n;++i){
        cin>>a[i];
    }
    int sum=0;
    for(long long int i=1;i<=n-1;++i){
            //cout << i << " ";
        for(long long int j=i+1;j<=n;++j){
            sum+=(a[i]*a[j]);
        }
    }
    cout << sum%1000000007;
}


Compiler output:
a.cc: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 ll long long
#define mod (ll)(1e9+7)

int main()
{
	// added the two lines below
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, sum = 0;
	cin >> n;
	int a[n];
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (ll i = 0; i  < n-1; i++) {
		for (ll j = i + 1; j < n; j++) {
			sum = sum + (a[i] * a[j];
		}
	}
	cout << (sum ) % mod << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:49: error: expected ')' before ';' token
   19 |                         sum = sum + (a[i] * a[j];
      |                                     ~           ^
      |                                                 )
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 [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
        S=0;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=AA%(1000000007);
             S=S+X;
             if(S>10000000070){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:22: error: integer number too large
             if(S>10000000070){
                  ^
1 error
Language: C++

#include <bits/stdc++.h>

#define debug_input freopen("stdin.in", "r", stdin)
#define debug_output freopen("stdout.out", "w", stdout)
#define FOR(i, a, b) for(ll i = a; i <= b; i++)
#define FORALL(i, n) for(ll i = 0; i < n; i++)
#define FORD(i, a, b) for(ll i = a; i >= b; i--)
#define SORT(a) sort(a.begin(), a.end())
#define REV(a) reverse(a.begin(), a.end())
#define NP(a) next_permutation(a.begin(), a.end())
#define endl "\n"
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

ll n;
ll a[200005];
ll sum[200005];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	ll mod = 1e9 + 7;
	ll tot = 0;
	ll ans = 0;

	cin >> n;	

	sum[0] = 0;
	FOR(i, 1, n) {
		cin >> a[i];
		sum[i] = (sum[i - 1] + a[i]) % mod;
	}

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

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

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin>>n;
  long long sum = 0;
  long long int A[n];
  for(int i = 0 ; i < n; i++){
    cin>>A[i];
  }
  long long a;
  for(int i = 0 ; i < n; i++){
    a = A[i];
    for(int j = i+1; j<n; j++){
      sum += a*A[j];
    }
  }
  cout<<sum%(pow(10,9)+7);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   20 |   cout<<sum%(pow(10,9)+7);
      |         ~~~^~~~~~~~~~~~~~
      |         |             |
      |         long long 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);
        // 整数の入力
        int N = sc.nextInt();
      
      	int [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
        S=0;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=AA%(1000000007);
             S=S+X;
             if(S>1000000007000000){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:22: error: integer number too large
             if(S>1000000007000000){
                  ^
1 error
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
const int mod=1e9+7;
                     // I'm in Love with Experience. �😎�
void solve()
{
    ll N;cin>>N;
    ll A[N]; for(ll i=0;i<N;++i)cin>>A[i];
    ll s=0;
    for (ll i = 0; i < n; i++)s = (s + A[i]%mod)%mod; 
    ll sq = (s*s)%mod; 
    ll ind= 0; 
    for (ll i = 0; i < n; i++) ind=(ind+ (A[i]*A[i])%mod)%mod; 
    cout<<(s - ind)/2)%mod; 
}
int main(void)
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);solve();exit(0);
}/*Solved By:- Ritik Agarwal*/

Compiler output:
a.cc: In function 'void solve()':
a.cc:11:24: error: 'n' was not declared in this scope
   11 |     for (ll i = 0; i < n; i++)s = (s + A[i]%mod)%mod;
      |                        ^
a.cc:14:24: error: 'n' was not declared in this scope
   14 |     for (ll i = 0; i < n; i++) ind=(ind+ (A[i]*A[i])%mod)%mod;
      |                        ^
a.cc:15:22: error: expected ';' before ')' token
   15 |     cout<<(s - ind)/2)%mod;
      |                      ^
      |                      ;
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 [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
        S=0;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=AA%(1000000007);
             S=S+X;
             if(S>1000000007000000000){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:22: error: integer number too large
             if(S>1000000007000000000){
                  ^
1 error
Language: C++

#include<iostream>
using namespace std;
 int main()
 {
   int n;
    cin>>n;
    vector<int>v;
   int temp, sum=0;
   for(int i=0; i<n; i++)
   {
     cin>>temp;
     v.push_back(temp);
   }
    for(int i=0; i<n; i++) 
    {
       for(int j=1; j<n; j++)
       {
         sum+=i*j; 
       }}
   cout<<sum%1000000007<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int>v;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int>v;
      |            ^~~
a.cc:12:6: error: 'v' was not declared in this scope
   12 |      v.push_back(temp);
      |      ^
a.cc:20:31: error: expected '}' at end of input
   20 |    cout<<sum%1000000007<<endl;
      |                               ^
a.cc:4:2: note: to match this '{'
    4 |  {
      |  ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  //cout << M << endl;*/

  vector<unsigned long int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }

  unsigned long int tmp_sum = 0:
  for(int i = 0; i < vec.size(); i++){
    tmp_sum = tmp_sum+vec.at(i);
  }

  unsigned long int sum = 0;

  for(int i = 0; i < vec.size(); i++){
    tmp_sum = tmp_sum - vec.at(i);
    sum = (sum + vec.at(i) * tmp_sum) % 1000000007;
  }

  cout << sum % 1000000007 << endl;
  /*for (int i = 0; i < vec.size(); i ++){
    cout << vec.at(i) << endl;
  }

  for (int i = 0; i < vec.size()-1; i ++){
    cout << vec.at(i) << " ";
  }
  cout << vec.at(vec.size() - 1) << endl;*/
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ',' or ';' before ':' token
   14 |   unsigned long int tmp_sum = 0:
      |                                ^
a.cc:15:18: error: 'i' was not declared in this scope
   15 |   for(int i = 0; i < vec.size(); i++){
      |                  ^
Language: C++

#include <iostream>
#include <vector>


int main() {
	using namespace std;

	unsigned int n,j,k,l=0;
	vector<unsigned int> a(0);

	cin >> n;

	for (j = 0; j < n; j++) {
		cin >> k;
		a.push_back(k);
	}
	for (k = 0; k+1 < n; k++) {
		for (j = k+1; j < n; j++) {
			l += a[k] * a[j];
		}
	}
	if(l<(pow(10,9)+7))
		cout << l  ;
	else
		cout << l%(unsigned int)(pow(10,9)+7);

		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'pow' was not declared in this scope
   22 |         if(l<(pow(10,9)+7))
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
	ll n,i,f=0;
	ll d=1000000007;
	cin>>n;
	ll a[n];
	ll s[n];
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	s[0]=a[0]%d;
	for(i=1;i<n;i++)
	{
		s[i]=((a[i]%d)+(s[i-1]%d))%d;
	}
	for(i=0;i<n-1;i++)
	{
		f+=((a[i]%d)*((s[n-1]%d)-(s[i]%d))%d;
	}
	cout<<f%d<<endl;
	return;
}





int main()
{
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif

	int t = 1;
	//cin >> t;

	while (t--)
	{
		solve();
	}


	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:22:53: error: expected ')' before ';' token
   22 |                 f+=((a[i]%d)*((s[n-1]%d)-(s[i]%d))%d;
      |                    ~                                ^
      |                                                     )
Language: C++

import math
n=int(input())
a=list(map(int,input().strip().split()))[:n]
sum=0
m=0
for i in range (n):
	sum=sum+a[i]
	m=m+a[i]*a[i]
ans=sum*sum-m
mod=1000*1000*1000+7
op=ans/2
op=op%mod
op=math.floor(op)
print(op)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

# cook your dish here
n=int(input())
a = list(map(int,input().split()))
sum = 0
sq = 0
mod = 1000000007
for i in range(len(a)):
    sum += a[i]
    sq += a[i]*a[i]
    sum = sum%mod 
    sq = sq%mod
ans = (sum*sum - sq + mod)%mod
print(int(ans/2))

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #cook
    1 | # cook your dish here
      |   ^~~~
a.cc:2:1: error: 'n' does not name a type
    2 | n=int(input())
      | ^
Language: C++

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


int main(){
	ll n,sum=0ll,ans=0ll;
	int i;
	cin>>n;
	vector<ll> arr(n);

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

	for(i=0;i<n;i++)
		sum=(sum+arr[i])%mod;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: expected ';' before numeric constant
   21 |                 ans+=(1ll*arr[i]*sum)5mod;
      |                                      ^~~~
      |                                      ;
Language: C++

//177 c 求乘积之和
#include <bits/stdc++.h>
using namespace std;
const int MAX=20e5+6;
long long sl[MAX]; 
int main(){
	int n;
	cin>>n;
	for (int i=1;i<=n;i++) {
		cin>>sl[i];
	}
	long long ans=0;
	for (int j=1;j<=n-1;j++) {
		for (int k=j+1;k<=n;k++) {
			ans+=sl[j]*sl[k]
			if(ans>=1000000007){
				ans%=1000000007;	
			} 
		}
	}
	cout<<ans<<endl;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:41: error: expected ';' before 'if'
   15 |                         ans+=sl[j]*sl[k]
      |                                         ^
      |                                         ;
   16 |                         if(ans>=1000000007){
      |                         ~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const int INF = 0x3f3f3f3f;
const int maxn = 1100000;
const int mod = 1e9 + 7;
ll a[maxn];
ll sum[maxn];
void exgcd(ll a, ll b, ll &x, ll &y, ll &d)
{
    if (!b)
    {
        d = a, x = 1, y = 0;
    }
    else
    {
        exgcd(b, a % b, y, x, d);
        y -= x * (a / b);
    }
}
ll inv(ll t, ll p)
{ //如果不存在，返回-1
    ll d, x, y;
    exgcd(t, p, x, y, d);
    return d == 1 ? (x % p + p) % p : -1;
}
void run_case()
{
    int n;
    cin >> n;
    ll tot = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        sum[i] = sum[i - 1] + a[i];
        tot += a[i];
    }
    for (int i = 1; i <= n; i++)
    {
        ll cur = tot - sum[i];
        ans = (ans + cur % p mod * a[i] % mod) % mod;
    }
    cout << ans << "\n";
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    run_case();
    cout.flush();
    return 0;
}

Compiler output:
a.cc: In function 'void run_case()':
a.cc:53:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   53 |         ans = (ans + cur % p mod * a[i] % mod) % mod;
      |         ^~~
      |         abs
a.cc:53:28: error: 'p' was not declared in this scope
   53 |         ans = (ans + cur % p mod * a[i] % mod) % mod;
      |                            ^
a.cc:53:29: error: expected ')' before 'mod'
   53 |         ans = (ans + cur % p mod * a[i] % mod) % mod;
      |               ~             ^~~~
      |                             )
a.cc:55:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   55 |     cout << ans << "\n";
      |             ^~~
      |             abs
Language: Java

import java.math.BigInteger;
import java.util.*;

public class Main2 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		long array[];
		array = new long[n];
		for (int i = 0; i < n; i++) {
			array[i] = Long.parseLong(sc.next());
		}

		BigInteger sum = BigInteger.ZERO;
		BigInteger tate = BigInteger.ZERO;
		BigInteger yoko = BigInteger.ZERO;
		for (int i = 0; i < n - 1; i++) {
			tate = tate.add(BigInteger.valueOf(array[i]));
			yoko = BigInteger.valueOf(array[i + 1]);
			sum = sum.add(tate.multiply(yoko));
		}

		sum = sum.remainder(BigInteger.valueOf(1000000007));

		System.out.println(sum);

	}
}


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

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

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

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
  cin>>arr[i];
  
  long int sum=0;
  for(int i=0;i<n-1;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      sum+=arr[i]*arr[j];
    }
  }
   sum=sum%(pow(10,9)+7);
  cout<<sum;
  return 0;
}


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

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
  cin>>arr[i];
  
  long int sum=0;
  for(int i=0;i<n-1;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      sum+=arr[i]*arr[j];
    }
  }
  double s=double(sum)%(pow(10,9)+7);
  cout<<s;
  return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   20 |   cout<<sum%(1e9+7)<<endl;
      |         ~~~^~~~~~~~
      |         |       |
      |         |       double
      |         ll {aka long long int}
Language: Java

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

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
	int[] data=new int[n];
	BigInteger t;
    BigInteger sum=BigInteger.valueOf(0);
	BigInteger doubled=BigInteger.valueOf(0);
    for(int i=0;i<data.length;i++){
      data[i]=sc.next();
      t=BigInteger.valueOf(data[i]);
      sum=sum.add(t);
      doubled=doubled.add(t.multiply(t));
    }
    BigInteger multied=sum.multiply(sum);
    multied=multied.subtract(doubled).divide(BigInteger.valueOf(2)).mod(BigInteger.valueOf(1000000007));
    
    System.out.println(multied.intValue());
    
    
  }
}

Compiler output:
Main.java:13: error: incompatible types: String cannot be converted to int
      data[i]=sc.next();
                     ^
1 error
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 [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=AA%(1000000007);
             S=S+X;
             if(S>1000000007){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:20: error: variable S might not have been initialized
             S=S+X;
               ^
Main.java:26: error: variable S might not have been initialized
      System.out.println(S);
                         ^
2 errors
Language: Java

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

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
	int[] data=new int[n];
	BigInteger t;
    BigInteger sum=BigInteger.valueOf(0);
	BigInteger doubled=BigInteger.valueOf(0);
    for(int i=0;i<data.length;i++){
      data[i]=sc.next();
      t=BigInteger.valueOf(data[i]);
      sum=sum.add(t);
      doubled=doubled.add(t.multiply(t));
    }
    BigInteger multied=sum.multiply(sum);
    multied=multied.subtract(doubled).divide(BigInteger.valueOf(2)).mod(BigInteger.valueOf(1000000007))
    
    System.out.println(multied.intValue());
    
    
  }
}

Compiler output:
Main.java:19: error: ';' expected
    multied=multied.subtract(doubled).divide(BigInteger.valueOf(2)).mod(BigInteger.valueOf(1000000007))
                                                                                                       ^
1 error
Language: Java

import java.util.*;
public class mt{
	public static void main(String[] args) {
		long mod = 1000000007;
		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[] suf = new long[n];
		suf[n-1]=arr[n-1];
		for(int i=n-2;i>=0;i--){
			suf[i]=(arr[i]+suf[i+1])%mod;
		}
		long ans=0;
		
		for(int i=0;i<n-1;i++){
			ans= (ans+(arr[i]*suf[i+1]))%mod;
		}
		System.out.println(ans%mod);
	}
}

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

#include<bits/stdc++.h>

#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ll long long
#define ld long double
#define pb push_back
#define MOD 1000000007
#define LLMN LONG_LONG_MIN
#define LLMX LONG_LONG_MAX
#define LDMX LDBL_MAX
#define LDMN LDBL_MIN
#define MAX 1000000
#define pll pair<ll, ll>
#define vl vector<ll>
#define vll vector< vector<ll> >
#define vb vector<bool>
#define vbb vector< vector<bool> >    

using namespace std;   


        
int main()
 {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n, x;
  	vector<ll>> arr;
  	cin>>n;
  	for(ll i=0;i<n;i++) {
      cin>>x;
      arr.push_back(x);
    }
  
  	ll sum =0;
  	for(ll i=0;i<n-1;i++){
		for(ll j=i+1;j<n;j++){
          sum = sum + (arr[i] * arr[j])%MOD;
        }
    }
  	cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: expected unqualified-id before '>' token
   32 |         vector<ll>> arr;
      |                  ^~
a.cc:36:7: error: 'arr' was not declared in this scope
   36 |       arr.push_back(x);
      |       ^~~
a.cc:42:24: error: 'arr' was not declared in this scope
   42 |           sum = sum + (arr[i] * arr[j])%MOD;
      |                        ^~~
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 [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=A%(1000000007);
             S=S+X;
             if(S>1000000007){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:19: error: bad operand types for binary operator '%'
             X=A%(1000000007);
                ^
  first type:  int[]
  second type: int
1 error
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
  cin>>ar[i];
  
  long int sum=0;
  for(int i=0;i<n-1;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      sum++arr[i]*arr[j];
    }
  }
  sum=double(sum)%(pow(10,9)+7);
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'ar' was not declared in this scope; did you mean 'arr'?
   11 |   cin>>ar[i];
      |        ^~
      |        arr
a.cc:18:12: error: expected ';' before 'arr'
   18 |       sum++arr[i]*arr[j];
      |            ^~~
      |            ;
a.cc:21:18: error: invalid operands of types 'double' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   21 |   sum=double(sum)%(pow(10,9)+7);
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~
      |       |                     |
      |       double                __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);
        // 整数の入力
        int N = sc.nextInt();
      
      	int [] A =new int [N+1];
      	for(int i=1;i<N+1;i++){
        	int A[i] = sc.nextInt();
        }

      	long X;
        long  AA ;
      	long S;
		for(int i=1;i<N;i++){
          for(int j=i+1;j<N+1;j++){
        	 AA = A[i]*A[j];
             X=A%(1000000007);
             S=S+X;
             if(S>1000000007){
             	S=S%1000000007;
             }
          }
        }
      System.out.println(S);

    }
}


Compiler output:
Main.java:10: error: ']' expected
        	int A[i] = sc.nextInt();
        	      ^
Main.java:10: error: ';' expected
        	int A[i] = sc.nextInt();
        	       ^
2 errors
Language: C++

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

int main() {
    const int long long = 1000000007;
    long long N; 
    cin >> N;
    vector<long long> A(N, 0);

    long long ans = 0;
    long long souwa = 0;
    for(int i = 0; i < N; i++){
        cin >> A[i];
        souwa += A[i];
    }

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

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: expected unqualified-id before '=' token
    5 |     const int long long = 1000000007;
      |                         ^
a.cc:20:18: error: 'MOD' was not declared in this scope
   20 |         if(ans > MOD){
      |                  ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
using namespace std;

const int SIZE=2e5+7;
const int Mod=1e9+7;
long long f[SIZE];
long long a[SIZE];
int n;

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	REP(i,n)cin>>a[i];
	for(int i=n-1;i>=0;i--)
		f[i]=f[i+1]+a[i+1];a
	long long ans=0;
	REP(i,n-1)
		ans=(ans+a[i]*f[i])%Mod;
	cout<<ans<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: expected ';' before 'long'
   22 |                 f[i]=f[i+1]+a[i+1];a
      |                                     ^
      |                                     ;
   23 |         long long ans=0;
      |         ~~~~                         
a.cc:25:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |                 ans=(ans+a[i]*f[i])%Mod;
      |                 ^~~
      |                 abs
a.cc:26:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include<bits/stdc++.h>
#include<math.h>
using namespace std;
int main()
{long int n;
 cin>>n;
 long int arr[n];
 unsigned long long int sum=0;
for(long int i=0;i<n;i++)
	cin>>arr[i];
for(long int i=0;i<n-1;i++)
	for(long int j=i+1;j<n;j++)
  		sum+=arr[i]*arr[j];
cout<<(sum)%(pow(10,9)+7);
return 0;}

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

import java.util.Scanner;
public class C {
    public static void main(String[] args) {
        Scanner kala=new Scanner (System.in);
        
         int N=kala.nextInt();
         
         int a[]=new int[N];
            
         for (int i = 0; i < a.length; i++) {
            a[i]=kala.nextInt();
        }
         int sum=0;
         for (int i = 0; i < N-1; i++) {
             for (int j = i+1; j < N; j++) {
                 sum=sum+a[i]*a[j];
             }
        }
         System.out.println(sum);
        }
}


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

#include <iostream>
#include <vector>

int main() {
	using namespace std;

	int n,j,k,l=0;
	vector<int> a(0);

	cin >> n;

	for (j = 0; j < n; j++) {
		cin >> k;
		a.push_back(k);
	}
	for (k = 0; k+1 < n; k++) {
		for (j = k+1; j < n; j++) {
			l += a[k] * a[j];
		}
	}
	if(l<(pow(10,9)+7))
		cout << l  ;
	else
		cout << l/(pow(10,9)+7);
		return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: 'pow' was not declared in this scope
   21 |         if(l<(pow(10,9)+7))
      |               ^~~
a.cc:25:26: error: expected '}' at end of input
   25 |                 return 0;
      |                          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

int main()
    {
       long long a=0,d=0;
        cin >>a;
        long long b[10000000000];
        for (long long i = 0; i < a; i++)
        {
            cin>>b[i];
        }
        for (long long i = 0; i < a; i++)
        {

            for (long long j = 0; j < a; j++)
            {
            d+=b[i]*b[j];
            }
        }
        cout<<d<<endl;
     return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >>a;
      |         ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout<<d<<endl;
      |         ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope
   18 |         cout<<d<<endl;
      |                  ^~~~
Language: C++

#include <iostream> 

using namespace std; 
typedef long long ll; 
t
// required function 

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

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

    ll array_sum = 0; 

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

        array_sum = array_sum + A[i]; 

  

    // calcualting square of array sum 

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

    ll array_sum_square = array_sum * array_sum; 

  

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

    ll individual_square_sum = 0; 

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

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

  

    // required sum is (array_sum_square - 

    // individual_square_sum) / 2 

    return (array_sum_square - individual_square_sum)/2; 
} 

  
// Driver code 

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



    

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


    return 0; 
} 


Compiler output:
a.cc:5:1: error: 't' does not name a type; did you mean 'tm'?
    5 | t
      | ^
      | tm
a.cc: In function 'int main()':
a.cc:63:13: error: 'findProductSum' was not declared in this scope
   63 |     cout << findProductSum(A,n)%m<<endl;
      |             ^~~~~~~~~~~~~~