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

#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 1e5 + 5;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;

typedef long long ll;
typedef vector<int> vi;

long long mod(long long x){
        return ((x%M + M)%M);
    }
long long add(long long a, long long b){
        return mod(mod(a)+mod(b));
    }
long long mul(long long a, long long b){
        return mod(mod(a)*mod(b));
    }


int solve(vector <int> arr, int n) {
    vector <ll> pref(n+1);
    for(int i=n-1;i>=0;i--){
        pref[i]=pref[i+1]+arr[i];
    }

    ll ans=0;
    for(int i=0;i<n;i++){
        ans=add(and,mul(arr[i],pref[i]));
    }
    return ans;
   
    
}

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

    #ifndef ONLINE_JUDGE
        freopen("inputcpp.txt", "r", stdin);
        freopen("outputcpp.txt", "w", stdout);
    #endif

    int n;
    cin>>n;
    vector <int> arr(n);
    for (int i=0;i<n;i++){
        cin>>arr[i];
    }
    cout<<solve(arr,n)<<endl;
    
    
}

Compiler output:
a.cc: In function 'long long int mod(long long int)':
a.cc:13:20: error: 'M' was not declared in this scope
   13 |         return ((x%M + M)%M);
      |                    ^
a.cc: In function 'int solve(std::vector<int>, int)':
a.cc:31:20: error: expected identifier before ',' token
   31 |         ans=add(and,mul(arr[i],pref[i]));
      |                    ^
Language: C++

#include<stdio.h>

typedef long long int * pint;

int main()
{
  int n;
  scanf("%d", &n);
  
  long long int num[n], cursum[n], sum = 0;
  scanf("%lld", num);
  *cursum = *num;
  for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
  {
  	scanf("%lld", p);
    (*q) = (*(q - 1)) + (*p);
    if ((*q) > (2 << 60)) (*q) %= 1000000007LL;
  }
  
  for (pint p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
  {
    sum += *p * *q;
    if (sum > (2 << 60)) sum %= 1000000007;
  }
  
  printf("%lld", sum);
  
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: cannot convert 'long long int*' to 'long long int**' in initialization
   13 |   for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                                ~~~~~~~^~~
      |                                       |
      |                                       long long int*
a.cc:17:19: warning: left shift count >= width of type [-Wshift-count-overflow]
   17 |     if ((*q) > (2 << 60)) (*q) %= 1000000007LL;
      |                 ~~^~~~~
a.cc:17:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if ((*q) > (2 << 60)) (*q) %= 1000000007LL;
      |         ~~~~~^~~~~~~~~~~
a.cc:17:32: error: invalid operands of types 'pint' {aka 'long long int*'} and 'long long int' to binary 'operator%'
   17 |     if ((*q) > (2 << 60)) (*q) %= 1000000007LL;
      |                           ~~~~~^~~~~~~~~~~~~~~
a.cc:17:32: note:   in evaluation of 'operator%=(pint {aka long long int*}, long long int)'
a.cc:23:18: warning: left shift count >= width of type [-Wshift-count-overflow]
   23 |     if (sum > (2 << 60)) sum %= 1000000007;
      |                ~~^~~~~
Language: C

#include<stdio.h>

typedef int * pint;

int main()
{
  int n;
  scanf("%d", &n);
  
  long long int num[n], cursum[n], total = 0;
  scanf("%lld", num);
  *cursum = *num;
  for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
  {
  	scanf("%lld", p);
    *q = *(q - 1) + *p;
    if ((*q) > (2 << 60)) *q %= 1000000007;
  }
  
  for (pint p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
  {
    sum += *p * *q;
    if (sum > (2 << 60)) sum %= 1000000007;
  }
  
  printf("%lld", sum);
  
  return 0;
}
  


Compiler output:
main.c: In function 'main':
main.c:13:17: error: initialization of 'pint' {aka 'int *'} from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   13 |   for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                 ^~~
main.c:13:32: error: initialization of 'int **' from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   13 |   for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                                ^~~~~~
main.c:13:49: error: initialization of 'pint' {aka 'int *'} from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   13 |   for (pint p = num + 1, * q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                                                 ^~~
main.c:17:19: warning: left shift count >= width of type [-Wshift-count-overflow]
   17 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |                   ^~
main.c:17:14: warning: comparison between pointer and integer
   17 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |              ^
main.c:17:30: error: invalid operands to binary % (have 'pint' {aka 'int *'} and 'int')
   17 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |                           ~~ ^~
      |                           |
      |                           pint {aka int *}
main.c:20:17: error: initialization of 'pint' {aka 'int *'} from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   20 |   for (pint p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                 ^~~
main.c:20:30: error: initialization of 'pint' {aka 'int *'} from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   20 |   for (pint p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                              ^~~~~~
main.c:20:43: error: initialization of 'pint' {aka 'int *'} from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
   20 |   for (pint p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                                           ^~~
main.c:22:5: error: 'sum' undeclared (first use in this function); did you mean 'num'?
   22 |     sum += *p * *q;
      |     ^~~
      |     num
main.c:22:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:18: warning: left shift count >= width of type [-Wshift-count-overflow]
   23 |     if (sum > (2 << 60)) sum %= 1000000007;
      |                  ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll inf = 1e18;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    ll n;
    cin >> n;
    ll arr[n];
    ll s = 0;
    for(int &i : arr)
        cin >> i , s += i;
    int mod = 1e9 + 7;
    ll ans = 0;
    for(int i = 0 ; i < n ; i++){
        ans = ans + arr[i] * (s - arr[i]);
        ans = ans % mod;
    }
    cout<<ans/2;
}


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

//Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
 
#define ff              first
#define ss              second
#define int             long long
#define endl            "\n"
#define pb              push_back
#define ppb              pop_back
#define mp              make_pair
#define pii             pair<int, int>
#define vi              vector<int>
#define all(x)          (x).begin(), (x).end()
#define mii             map<int, int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int, vi, greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define M               1e9 + 7
#define inf             1e18
#define sp(x,y)         fixed << setprecision(y) << x
#define w(x)            int x; cin >> x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());


//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

inline int ceili(int x, int y) { return (x + y - 1) / y; }
inline int mod(int x) { return ((x % M + M) % M); }
inline int add_mod(int a, int b) { return mod(mod(a) + mod(b)); }
inline int mul_mod(int a, int b){ return mod(mod(a) * mod(b)); }
 
void solve()
{
    int n; cin >> n;
    vector<int> a(n);

    for(auto &it : a) cin >> it;

    vector<int> suf(n + 1);
    for(int i = n - 1; i >= 1; --i) {
        suf[i] = suf[i + 1] + a[i];
    }

    int ans = 0;
    for(int i = 0; i < n; ++i) {
        ans = add_mod(ans, mul_mod(a[i], suf[i + 1]));
    }

    cout << ans << endl;
}
 
int32_t main()
{
    FIO;

    solve();

    return 0;
}

Compiler output:
a.cc: In function 'long long int mod(long long int)':
a.cc:33:36: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   33 | inline int mod(int x) { return ((x % M + M) % M); }
      |                                  ~ ^
      |                                  |
      |                                  long long int
Language: C++

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

int main() {
    int n;
    cin >> n;
    long long int v[200000];
    long long int res = 0;
    for (int i = 0; i < n; i++) {
        long long int temp;
        cin >> temp;
        while (temp >= 1000000007) {
            temp -= 1000000007;
        }
        v.push_back(temp);
        for (int j = 0; j < i; j++) {
            res += temp * v[j];
        }
        while (res >= 1000000007) {
            res -= 1000000007;
        }
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: request for member 'push_back' in 'v', which is of non-class type 'long long int [200000]'
   16 |         v.push_back(temp);
      |           ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>

#define ll long long0

using namespace std ;

int main()
{
	ll n;
	cin>>n;
	ll A[n];
	for(ll i=0 ; i<n ; i++)
		cin>>A[i];
	vector<ll> v;
	ll sum = 0;
	for(ll i=0 ; i<n ; i++)
		sum = (sum+A[i]);
	ll curr = 0 ;
	for(ll i=0 ; i<n ; i++)
	{
		curr+=A[i];
		v.push_back(sum-curr);
	}
	ll ans = 0 ;
	for(ll i=0 ; i<n ; i++)
	{
		ans = (ans+(long long)A[i]*v[i])%1000000007;
	}
	cout<<ans%1000000007;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected initializer before 'n'
    9 |         ll n;
      |            ^
a.cc:10:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |         cin>>n;
      |              ^
      |              yn
a.cc:11:12: error: expected initializer before 'A'
   11 |         ll A[n];
      |            ^
a.cc:12:16: error: expected ';' before 'i'
   12 |         for(ll i=0 ; i<n ; i++)
      |                ^
a.cc:12:16: error: 'i' was not declared in this scope
a.cc:12:25: error: expected ')' before ';' token
   12 |         for(ll i=0 ; i<n ; i++)
      |            ~            ^~
      |                         )
a.cc:12:28: error: 'i' was not declared in this scope
   12 |         for(ll i=0 ; i<n ; i++)
      |                            ^
a.cc:14:18: error: template argument 1 is invalid
   14 |         vector<ll> v;
      |                  ^
a.cc:14:18: error: template argument 2 is invalid
a.cc:15:12: error: expected initializer before 'sum'
   15 |         ll sum = 0;
      |            ^~~
a.cc:16:16: error: expected ';' before 'i'
   16 |         for(ll i=0 ; i<n ; i++)
      |                ^
a.cc:16:25: error: expected ')' before ';' token
   16 |         for(ll i=0 ; i<n ; i++)
      |            ~            ^~
      |                         )
a.cc:18:12: error: expected initializer before 'curr'
   18 |         ll curr = 0 ;
      |            ^~~~
a.cc:19:16: error: expected ';' before 'i'
   19 |         for(ll i=0 ; i<n ; i++)
      |                ^
a.cc:19:25: error: expected ')' before ';' token
   19 |         for(ll i=0 ; i<n ; i++)
      |            ~            ^~
      |                         )
a.cc:24:12: error: expected initializer before 'ans'
   24 |         ll ans = 0 ;
      |            ^~~
a.cc:25:16: error: expected ';' before 'i'
   25 |         for(ll i=0 ; i<n ; i++)
      |                ^
a.cc:25:25: error: expected ')' before ';' token
   25 |         for(ll i=0 ; i<n ; i++)
      |            ~            ^~
      |                         )
a.cc:29:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         cout<<ans%1000000007;
      |               ^~~
      |               abs
Language: C++

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

const ll MOD = 1000000007;
int main() {
  int 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 += A[i];
    sum %= MOD;
  }
  
  sum1 = (sum * sum) % MOD; 
  
  ll sum2 = 0;
  for (int i = 0; i < N; i++) {
    sum2 += A[i] * A[i];
    sum2 %= MOD;
  }
  
  cout << (sum1 - sum2) / 2 << endl;
  
  
}

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

/*
* Problem Statement: 
* Author: ganpa
*/
#include <bits/stdc++.h>

#define mod 1000000007
#define endl '\n'
#define int long long int
using namespace std;

int v[200001];

int32_t main()
{
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> v[i];
    int ans = 0;
    for (int i = 0; i < n - 1; i++)
    {
        int temp = 0;
        for (int j = i + 1; j < n; j++)
        {
            temp += v[j];
        }
        ans = (sum + (((v[i] % mod) * (temp % mod)) % mod)) % mod;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:29:16: error: 'sum' was not declared in this scope
   29 |         ans = (sum + (((v[i] % mod) * (temp % mod)) % mod)) % mod;
      |                ^~~
Language: C++

using namespace std;

int main(){
  int N;
  cin >> N;
  long long int ans = 0;
  int mod = 1000000007;
  long long int sum = 0;
  vector<long long int> a(N);
  for(int i = 0; i < N; i++){
    cin >> a.at(i);
    ans += (a.at(i) * sum) % mod;
    sum += a.at(i);
  }
  cout << ans % mod << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | using namespace std;
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<long long int> a(N);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'long'
    9 |   vector<long long int> a(N);
      |          ^~~~
a.cc:11:12: error: 'a' was not declared in this scope
   11 |     cin >> a.at(i);
      |            ^
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << ans % mod << endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:24: error: 'endl' was not declared in this scope
   15 |   cout << ans % mod << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: Java

import java.util.Scanner;

//
class Main{
    final static int MOD = (int)(Math.pow(10, 9) + 7);

    static long[] cumulativeSum(int[] a) {
        long[] b = new long[a.length + 1];
        b[0] = 0L;
        for(int i = 0; i < a.length; i++)
            b[i + 1] = (b[i] + a[i]) % MOD;

        return b;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] a = new int[N];

        for(int i = 0; i < N; i++)
            a[i] = sc.nextLong();

        long[] b = cumulativeSum(a);

        long sum = 0L;
        for(int i = 0; i < N - 1; i++) {
            sum += (a[i] * (b[N] - b[i + 1] + MOD)) % MOD;
            sum %= MOD;
        }

        System.out.println(sum % MOD);
    }

}


Compiler output:
Main.java:22: error: incompatible types: possible lossy conversion from long to int
            a[i] = sc.nextLong();
                              ^
1 error
Language: Java

import java.util.Scanner;

public class Ctest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());

        long modA = (long)Math.pow(10, 9) + 7;

        long ans = 0;
        long total = 0;
        long a;
        for (int i = 0; i < n; i++) {
            a = Long.parseLong(sc.next());
            ans += total * a;
            ans %= modA;
            total += a;
            total %= modA;
        }
        System.out.print(ans);
    }
}


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

#include<iostream>

const int MOD = 1000000007;

typedef long long ULL;

using namespace std;

int main(){
    int N;
    int i;
    LL ans;
    LL *A;
    LL sum;

    cin >> N;
    A = new LL[N];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'LL' was not declared in this scope; did you mean 'ULL'?
   12 |     LL ans;
      |     ^~
      |     ULL
a.cc:13:9: error: 'A' was not declared in this scope
   13 |     LL *A;
      |         ^
a.cc:14:7: error: expected ';' before 'sum'
   14 |     LL sum;
      |       ^~~~
      |       ;
a.cc:17:13: error: 'LL' does not name a type; did you mean 'ULL'?
   17 |     A = new LL[N];
      |             ^~
      |             ULL
a.cc:19:5: error: 'sum' was not declared in this scope
   19 |     sum = 0;
      |     ^~~
a.cc:24:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     ans = 0;
      |     ^~~
      |     abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:44: error: expected ')' before ';' token
   19 |        sum=(sum%m + ((a[i]%m)*(a[j]%m)%m)%m;
      |            ~                               ^
Language: C++

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

const int N = 2e5 + 1;
const long long mod = 1e9 + 7;
int n;
long long a[N];
int main() 
{
  cin >> n;
  for(int i = 0; i < n; i++) {
  	for(int j = i + 1; j < n; j++) {
      ans += (a[i]*a[j])%mod;
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |       ans += (a[i]*a[j])%mod;
      |       ^~~
      |       abs
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout << ans;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
#define pb push-back
#define all(x) x.begin(),x.end()

using ll = long long int;
#define rep0(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i < n; i++)

using namespace std;

ll power(ll n, ll k)
{
	ll res = 1;
	while(k){
		if(k & 1){
			res *= n;
			k--;
		}
		else{
			n *= n;
			k /= 2;
		}
	}
	return res;
}

void solve()
{
	ll n; cin >> n;
	ll ar[n+1];
	rep1(i,n+1) cin >> ar[i];
	
  ll pre[n+1];
  memset(pre,0,sizeof(pre));
  
  rep1(i,n+1)
    pre[i] = (pre[i-1] + ar[i]) % mod;

  ll ans = 0;
  rep1(i,n+1)
    ans = (ans + (pre[i-1] * ar[i]) % mod) % mod;
 cout << ans << "\n";
}

int main()
{
	int tc=1;// cin >> tc;
	while(tc--)
	{
		solve();
	}
	return 0;
}

// ©beast_sr


Compiler output:
a.cc: In function 'void solve()':
a.cc:37:35: error: 'mod' was not declared in this scope; did you mean 'modf'?
   37 |     pre[i] = (pre[i-1] + ar[i]) % mod;
      |                                   ^~~
      |                                   modf
a.cc:41:39: error: 'mod' was not declared in this scope; did you mean 'modf'?
   41 |     ans = (ans + (pre[i-1] * ar[i]) % mod) % mod;
      |                                       ^~~
      |                                       modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
const ll INF = 9e18;

void print() { cout << endl; }
template <typename Head, typename... Tail>
void print(Head head, Tail... tail) {
    int size = sizeof...(Tail);
    cout << head;
    if (size > 0) {
        cout << " ";
    }
    print(tail...);
}

void print0() {}
template <typename Head, typename... Tail>
void print0(Head head, Tail... tail) {
    cout << head;
    print0(tail...);
}

vector<ll> mkprimes(ll N) {
    vector<bool> isprime(N + 1);
    vector<ll> primes;
    for (ll i = 0; i <= N; i++) {
        isprime[i] = true;
    }
    isprime[0] = false;
    isprime[1] = false;

    for (ll i = 2; i <= N; i++) {
        if (isprime[i]) {
            primes.push_back(i);
            for (ll j = 2 * i; j <= N; j += i) {  // 素数iの倍数は素数ではない
                isprime[j] = false;
            }
        }
    }
    return primes;
}

set<ll> primefact(ll n, vector<ll> &primes, vector<set<ll>> &cache) {
    if (n<=1){
      set<ll> s;
      return s
     }
    if (cache[n].size() > 0) {
       return cache[n];
    }
    for (ll p = 0; p < primes.size(); p++) {
        ll pr = primes[p];
        if (n % pr == 0) {
            set<ll> s = primefact(n/pr,primes,cache);
            s.insert(pr);
            cache[n] = s;
            return cache[n];
        }
    }
}

                

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll pmax = 1000002;
    auto primes = mkprimes(pmax);
    //vector<bool> isprime(pmax+1, false);
    vector<set<ll>> cache(pmax+1);
    for (auto ppr: primes) {
      //isprime[ppr] = true;
      cache[ppr].insert(ppr);
    }
    vector<vector<ll>> factors(N);
    vector<ll> usedprimes(pmax+1, 0);
    for (ll i = 0; i < N; i++) {
        ll n = A[i];
        for (ll pf : primefact(n, primes,  cache)) {
           usedprimes[pf]++;
        }
    }
    ll maxused = 0;
    for (auto u : usedprimes) {
        maxused = max(u, maxused);
    }
    if (maxused == N) {
        print("not coprime");
    } else if (maxused >= 2) {
        print("setwise coprime");
    } else {
        print("pairwise coprime");
    }
}


Compiler output:
a.cc: In function 'std::set<long int> primefact(ll, std::vector<long int>&, std::vector<std::set<long int> >&)':
a.cc:48:15: error: expected ';' before '}' token
   48 |       return s
      |               ^
      |               ;
   49 |      }
      |      ~         
a.cc:62:1: warning: control reaches end of non-void function [-Wreturn-type]
   62 | }
      | ^
Language: Java

import java.util.Scanner;

/**
 *
 * @author joeco
 */
public class Sums {
    
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        int n  = in.nextInt();
        int[] q = new int[n];
        for(int i = 0; i < n; i++)
            q[i] = in.nextInt();
        int res = sums(q, 0);
        System.out.println(res);
    }
    
    public static int sums(int[] q, int start){
        int res = 0;
        for(int i = start+1; i<q.length;i++)
            res+= (q[start] * q[i])%(int)(Math.pow(10,9)+7);
        
        if(start+2<q.length) res+=sums(q, start+1);
        
        return res;
    }
    
}


Compiler output:
Main.java:7: error: class Sums is public, should be declared in a file named Sums.java
public class Sums {
       ^
1 error
Language: Java

import java.util.Scanner;

/**
 *
 * @author joeco
 */
public class Sums {
    
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        int n  = in.nextInt();
        int[] q = new int[n];
        for(int i = 0; i < n; i++)
            q[i] = in.nextInt();
        int res = sums(q, 0);
        System.out.println(res);
    }
    
    public static int sums(int[] q, int start){
        int res = 0;
        for(int i = start+1; i<q.length;i++)
            res+= (q[start] * q[i])%(int)(Math.pow(10,9)+7);
        
        if(start+2<q.length) res+=sums(q, start+1);
        
        return res;
    }
    
}

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

#include <stdio.h>
#define maxn 200010
#define LL long long
#define mod 1000000007
LL a[maxn],sum,ans;//防int溢出，long long最方便。
int main(){
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%lld",&a[i]);
	for(i=2;i<=n;i++)sum=(sum+a[i])%mod;
	for(i=1;i<n;i++)ans=(ans+a[i]*sum)%mod,sum=((sum-a[i+1])%mod+mod)%mod;
	printf("%lld\n",ans);
	return 0;


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

#include <stdio.h>
#define maxn 200010
#define LL long long
#define mod 1000000007
LL a[maxn],sum,ans;//防int溢出，long long最方便。
int main(){
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%lld",&a[i]);
	for(i=2;i<=n;i++)sum=(sum+a[i])%mod;
	for(i=1;i<n;i++)ans=(ans+a[i]*sum)%mod,sum=((sum-a[i+1])%mod+mod)%mod;//((sum-a[i+1])%mod+mod)%mod可保证结果非负
	printf("%lld\n",ans);
	return 0;


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

#include <stdio.h>
#define maxn 200010
#define LL long long
#define mod 1000000007
LL a[maxn],sum,ans;//防int溢出，long long最方便。
int main(){
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%lld",&a[i]);
	for(i=2;i<=n;i++)sum=(sum+a[i])%mod;
	for(i=1;i<n;i++)ans=(ans+a[i]*sum)%mod,sum=((sum-a[i+1])%mod+mod)%mod;//((sum-a[i+1])%mod+mod)%mod可保证结果非负
	printf("%lld\n",ans);
	return 0;


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

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

int main(){
  int n;
  cin >> n;
  vector<long long> a(n);
  long long ans = 0;
  long long sum = 0;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    sum += a[i];
    sum %= 1000000007;
  }
  for(int i = 0; i < n; i++){
    sum -= a[i];
    if(sum < 0) sum += 1000000007;
    ans += a[i] * sum
    ans %= 1000000007;
  }
  cout << ans << endl;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected unqualified-id before '=' token
   13 |     int32_t=ans-m[i];
      |            ^
a.cc:14:10: error: 't' was not declared in this scope
   14 |     cnt+=t*m[i]%1000000007;
      |          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected unqualified-id before '=' token
   13 |     int64_t=ans-m[i];
      |            ^
a.cc:14:10: error: 't' was not declared in this scope
   14 |     cnt+=t*m[i]%1000000007;
      |          ^
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
//#define endl "\n";
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

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


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

#include <bits/stdc++.h> 
using namespace std; 
//#define endl "\n";
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll x,n;
    cin>>n;
    vector<ll>v;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        v.push_back(x);
    }
    ll sum=accumulate(v.begin(),v.end(),0);
    ll ans=0;
    for(int i=0;i<v.size();i++)
    {
        sum-=a[i];
        ans+=sum*a[i];
    }
    cout<<ans<<endl;
    return 0;
}


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

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

Compiler output:
a.cc:3:1: error: 'int128_t' does not name a type; did you mean 'int8_t'?
    3 | int128_t m[200005];
      | ^~~~~~~~
      | int8_t
a.cc: In function 'int main()':
a.cc:5:3: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
    5 |   int128_t n;
      |   ^~~~~~~~
      |   int8_t
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
a.cc:7:11: error: expected ';' before 'ans'
    7 |   int128_t ans=0,cnt=0;
      |           ^~~~
      |           ;
a.cc:8:15: error: expected ';' before 'i'
    8 |   for(int128_t i=0;i<n;i++){
      |               ^~
      |               ;
a.cc:8:20: error: 'i' was not declared in this scope
    8 |   for(int128_t i=0;i<n;i++){
      |                    ^
a.cc:9:10: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |     cin>>m[i];
      |          ^
      |          tm
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans+=m[i];
      |     ^~~
      |     abs
a.cc:12:15: error: expected ';' before 'i'
   12 |   for(int128_t i=0;i<n;i++){
      |               ^~
      |               ;
a.cc:12:20: error: 'i' was not declared in this scope
   12 |   for(int128_t i=0;i<n;i++){
      |                    ^
a.cc:13:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     int128_t=ans-m[i];
      |              ^~~
      |              abs
a.cc:13:18: error: 'm' was not declared in this scope; did you mean 'tm'?
   13 |     int128_t=ans-m[i];
      |                  ^
      |                  tm
a.cc:14:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |     cnt+=t*m[i]%1000000007;
      |     ^~~
      |     int
a.cc:14:10: error: 't' was not declared in this scope; did you mean 'tm'?
   14 |     cnt+=t*m[i]%1000000007;
      |          ^
      |          tm
a.cc:17:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |   cnt/=2;
      |   ^~~
      |   int
Language: C

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

int main(void){

 
  int i,j;
  int n;
  int sum;

  scanf("%d",n);

  int a= (int *)malloc(n);
  for(i=0;i<=n;i++)scanf("%d",a[i]);
  
 

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      sum += a[i]*a[j];
    }
  }
  printf("%d",sum % (1000000000+7));
      
  
  /*char a[1000];
  char b[1000];
  char *s;
  char *t;
  int count=0;
  int max = 0;
  int sizeS = sizeof(s)/sizeof(s[0]);
  int sizeT = sizeof(t)/sizeof(t[0]);

  scanf("%s",a);
  scanf("%s",b);

  s = (char *)malloc(sizeof(a)/sizeof(a[0]));
  t = (char *)malloc(sizeof(b)/sizeof(b[0]));
  for(int i = 0;i < sizeS;i++){
    s[i] = a[i];
  }
   for(int j = 0;j < sizeT;j++){
    t[j] = b[j];
  }
  

  for(int i=0;i<=sizeS-sizeT;i++){
    for(int j=0;j<sizeT;j++){
      if(s[i+j]==t[j]) count++;
    }
    if(count >= max) max = count;
    count = 0;
  }

  printf("%d %d\n",sizeS,max);
  printf("%d",sizeT-max);*/

  
  /*scanf("%d%d%d",&d,&t,&s);
  if(s*t >= d) printf("Yes");
  else printf("No");*/
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   13 |   int a= (int *)malloc(n);
      |                 ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include<string.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:13:17: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   13 |   int a= (int *)malloc(n);
      |                 ^~~~~~
main.c:13:17: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:13:10: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   13 |   int a= (int *)malloc(n);
      |          ^
main.c:14:32: error: subscripted value is neither array nor pointer nor vector
   14 |   for(i=0;i<=n;i++)scanf("%d",a[i]);
      |                                ^
main.c:20:15: error: subscripted value is neither array nor pointer nor vector
   20 |       sum += a[i]*a[j];
      |               ^
main.c:20:20: error: subscripted value is neither array nor pointer nor vector
   20 |       sum += a[i]*a[j];
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 200005;
int n;
int a[N];
int solve() {
  cin>>n;
  int prod = 0;
  int ans = 0;
  for (int i = 0; i < n; ++i){
    scanf("%d", &a[i]);
    ans = (ans + 1LL * a[i] * prod) % MOD;
    prod = (prod + a[i]) % MOD;
  }
  printf("%d\n", ans);
  return 0;
}
int main() {
  int t = 1;
  for (int tc = 0; tc < t; ++tc)
    solve()
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: expected ';' before '}' token
   22 |     solve()
      |            ^
      |            ;
   23 |   }
      |   ~         
a.cc: At global scope:
a.cc:24:3: error: expected unqualified-id before 'return'
   24 |   return 0;
      |   ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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

#define ll long long
#define pb push_back

const long long N = 1000000007;

int main() {
    int n;
    cin >> n;
    long long arr[n];
    for (int i = 0; i < n; i++){
        cin >> arr[i];
    }
    long long ans = 0;
    for (int i = 0; i < n - 1; i++){
        for (int j = i + 1; j < n; j++){v
            ans += arr[i] * arr[j];
            int k = ans / N;
            ans = ans - k * N;
        }
    }
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:41: error: 'v' was not declared in this scope
   18 |         for (int j = i + 1; j < n; j++){v
      |                                         ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N), B(N + 1);
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
    B.at(i + 1) = B.at(i) + A.at(i);
  }
  ll ans;
  
  for(int i = 0; i < N - 1; i++){
    ans += A.at(i) * ((B.at(N) - B.at(i - 1)) % 1000000007);
    ans %= 1000000007;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'll' was not declared in this scope
   12 |   ll ans;
      |   ^~
a.cc:15:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     ans += A.at(i) * ((B.at(N) - B.at(i - 1)) % 1000000007);
      |     ^~~
      |     abs
a.cc:19:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define vii vector<int>
#define task "ABC"
#define pll pair<ll, ll>
#define pii pair< ll, pair< ll, ll > >
#define fi first
#define se second

using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1e9 + 7;
using namespace std;
const int N = 2e5+5;
ll tong, m, n, k, t, T, ntest, ans, u, v, b[N], P[N][20], lab[N], sum[N];
string s;
ll a[N], d[N][53];
vector<pii> kq;
vector<pll> adj[N], adt[N];
bool check;
inline sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        a[i] = a[i] % mod;
    }
    b[n+1] = 0;
    for(int i = n; i > 0; i --)b[i] = (b[i+1] + a[i]) % mod;
    for(int i = 1; i < n; i ++)
    {
        ans = (ans + a[i] * b[i+1]) % mod;
    }
    cout << ans;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    sol();

}





Compiler output:
a.cc:22:8: error: ISO C++ forbids declaration of 'sol' with no type [-fpermissive]
   22 | inline sol()
      |        ^~~
a.cc: In function 'int sol()':
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define vii vector<int>
#define task "ABC"
#define pll pair<ll, ll>
#define pii pair< ll, pair< ll, ll > >
#define fi first
#define se second

using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1e9 + 7;
using namespace std;
const int N = 2e5+5;
ll tong, m, n, k, t, T, ntest, ans, u, v, b[N], P[N][20], lab[N], sum[N];
string s;
ll a[N], d[N][53];
vector<pii> kq;
vector<pll> adj[N], adt[N];
bool check;
inline sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        a[i] = a[i] % mod;
    }
    b[n+1] = 0;
    for(int i = n; i > 0; i --)b[i] = (b[i+1] + a[i]) % mod;
    for(int i = 1; i < n; i ++)
    {
        ans = (ans + a[i] * b[i+1]) % mod;
    }
    cout << ans;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if(fopen(task".INP", "r"))
    {
		freopen(task".INP","r",stdin);
		freopen(task".OUT","w",stdout);
    }
    sol();

}





Compiler output:
a.cc:22:8: error: ISO C++ forbids declaration of 'sol' with no type [-fpermissive]
   22 | inline sol()
      |        ^~~
a.cc: In function 'int sol()':
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define vii vector<int>
#define task "terrorists"
#define pll pair<ll, ll>
#define pii pair< ll, pair< ll, ll > >
#define fi first
#define se second

using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1e9 + 7;
using namespace std;
const int N = 2e5+5;
ll tong, m, n, k, t, T, ntest, ans, u, v, b[N], P[N][20], lab[N], sum[N];
string s;
ll a[N], d[N][53];
vector<pii> kq;
vector<pll> adj[N], adt[N];
bool check;
inline sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        a[i] = a[i] % mod;
    }
    b[n+1] = 0;
    for(int i = n; i > 0; i --)b[i] = (b[i+1] + a[i]) % mod;
    for(int i = 1; i < n; i ++)
    {
        ans = (ans + a[i] * b[i+1]) % mod;
    }
    cout << ans;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if(fopen(task".INP", "r"))
    {
		freopen(task".INP","r",stdin);
		freopen(task".OUT","w",stdout);
    }

    sol();

}





Compiler output:
a.cc:22:8: error: ISO C++ forbids declaration of 'sol' with no type [-fpermissive]
   22 | inline sol()
      |        ^~~
a.cc: In function 'int sol()':
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define vii vector<int>
#define task "terrorists"
#define pll pair<ll, ll>
#define pii pair< ll, pair< ll, ll > >
#define fi first
#define se second

using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1e9 + 7;
using namespace std;
const int N = 2e5+5;
ll tong, m, n, k, t, T, ntest, ans, u, v, b[N], P[N][20], lab[N], sum[N];
string s;
ll a[N], d[N][53];
vector<pii> kq;
vector<pll> adj[N], adt[N];
bool check;
inline sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
    }
    b[n+1] = 0;
    for(int i = n; i > 0; i --)b[i] = (b[i+1] + a[i]) % mod;
    for(int i = 1; i < n; i ++)
    {
        ans = (ans + a[i] * b[i+1]) % mod;
    }
    cout << ans;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if(fopen(task".INP", "r"))
    {
		freopen(task".INP","r",stdin);
		freopen(task".OUT","w",stdout);
    }

    sol();

}





Compiler output:
a.cc:22:8: error: ISO C++ forbids declaration of 'sol' with no type [-fpermissive]
   22 | inline sol()
      |        ^~~
a.cc: In function 'int sol()':
a.cc:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
   36 | }
      | ^
Language: C++

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

/*
struct Edge
{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<Edge>>;
*/

using Graph = vector<vector<int>>;

const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

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

const int MOD = 1000000007;

class mint
{
    ll x;

public:
    mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
    mint operator-() const
    {
        return mint(-x);
    }

    mint &operator+=(const mint &a)
    {
        if ((x += a.x) >= MOD)
            x -= MOD;
        return *this;
    }

    mint &operator-=(const mint &a)
    {
        if ((x += MOD - a.x) >= MOD)
            x -= MOD;
        return *this;
    }

    mint &operator*=(const mint &a)
    {
        (x *= a.x) %= MOD;
        return *this;
    }

    mint operator+(const mint &a)
    {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint &a)
    {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint &a)
    {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const
    {
        return pow(MOD - 2);
    }

    mint &operator/=(const mint &a)
    {
        return (*this) *= a.inv();
    }

    mint operator/(const mint &a)
    {
        mint res(*this);
        return res /= a;
    }

    friend ostream &operator<<(ostream &os, const mint &m)
    {
        os << m.x;
        return os;
    }
};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    mint sum = 0;
    for (int i = 0; i < N; i++)
    {
        int A;
        cin >> A;
        sum += A;
    }

    mint ans = sum;
    ans *= sum;
    // 中央の正方形を取り除く
    for (int i = 0; i < N; i++)
    {
        mint tmp = A[i];
        tmp *= A[i];
        ans -= tmp;
    }

    // 2で割る
    ans /= 2;
    cout << ans << endl;
    return 0;
}

// 面積を計算する．全てを足して2乗．真ん中(i = j)を抜いて/2をする(mod 1000000007で)


Compiler output:
a.cc: In function 'int main()':
a.cc:131:20: error: 'A' was not declared in this scope
  131 |         mint tmp = A[i];
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;

int main() {
  int a;
  cin >> a;
  long long int b[a];
  int sum = 0;
  int ans = 0;
  for(int i=0;i<a;i++){
  cin >> b[i];
  sum += b[i];
  sum %= MOD
  }
  for(int i=0;i<a-1;i++){
    for(int j = i+1;j<a;j++){
      ans = sum*b[i];
      ans %= MOD;
      sum -= b[i];
    }
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before '}' token
   14 |   sum %= MOD
      |             ^
      |             ;
   15 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
 
int main(){
    ll n,sum=0,summ=0,a[200005];
    cin>>n;
    rep(i,n){
        cin>>a[i];
        sum+=(a[i])%mod;
      sum%=mod;
        summ+=((a[i]%mod)*(a[i]%mod))%mod;
    }
    cout<<((((sum*sum)%mod-summ)%mod)%mod <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |     cout<<((((sum*sum)%mod-summ)%mod)%mod <<endl;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:17:49: error: expected ')' before ';' token
   17 |     cout<<((((sum*sum)%mod-summ)%mod)%mod <<endl;
      |           ~                                     ^
      |                                                 )
Language: Java

import java.util.*;

public class Main2 {

    public static void main(String args []) {

        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        long[] list = new long[n];
        long sum = 0;
        long mod = 1000000007;
        long ans = 0;

        for (int i = 0; i<n; i++) {
            long a = scan.nextLong();
            list[i] = a;
            sum += a;
            
        }

        for (int i = 0; i<n; i++) {

            sum= sum - list[i];
            ans += (list[i] * sum) % mod;
            ans %= mod;
        }

        System.out.println(ans);

    }
}


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: Java

import java.util.Scanner;
public class proj3 {
	
		public static void main(String[] args) {
			try(Scanner sc = new Scanner(System.in)){
				int n = sc.nextInt();
				long[] s = new long[n];
				long[] f = new long[n+1];
				long mod = 1000000007;
				f[0] = 0;
				for(int x = 0;x < n;x++) {
					s[x] = sc.nextInt();
					f[x + 1] = f[x] + s[x];
				}
				long d = 0;
				for(int x = 0;x < n;x++) {
					long sum = (f[n] - f[ x + 1]) % mod;
					d += s[x] * f[x]; 
					d = d % mod;
				}
				System.out.println(d);
			}
		}
}



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

import java.util.Scanner;
public class proj3 {
	
		public static void main(String[] args) {
			try(Scanner sc = new Scanner(System.in)){
				int n = sc.nextInt();
				long[] s = new long[n];
				long[] f = new long[n+1];
				long mod = 1000000007;
				f[0] = 0;
				for(int x = 0;x < n;x++) {
					s[x] = sc.nextInt();
					f[x + 1] = f[x] + s[x];
				}
				long d = 0;
				for(int x = 0;x < n;x++) {
					long sum = (f[n] - f[ x + 1]) % mod;
					d += s[x] * f[x]; 
					d = d % mod;
				}
				System.out.println(d);
			}
		}
}

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