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

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair

int gcd(int a, int b)
{
   if (b == 0) return a;
   return gcd(b, a % b);
}

int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
	int n,m;
	cin >> n >> m;
	string s,t;
	cin >> s >> t;
	if(gcd(n,m) == 0)
	{
		cout << "-1\n";
		return 0;
	}
	string y(len, '0'),z(len,'0');
	y[0] = s[0];
	for(int i=1;i<=n-1;i++)
	{
		y[(i*len)/n] = s[i];
	}
	z[0] = t[0];
	for(int i=1;i<=m-1;i++)
	{
		z[(i*len)/m] = t[i];
	}
	bool ans = true;
	for(int i=0;i<len;i++)
	{
		if(y[i] == '0' || z[i] == '0')
		{

		}
		else
		{
			if(y[i] != z[i])
			{
				ans = false;
				break;
			}
		}
	}
	if(ans)
		cout << len << "\n";
	else
		cout <<  "-1\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: 'len' was not declared in this scope
   27 |         string y(len, '0'),z(len,'0');
      |                  ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long gcd(long a, long b) {
  if(a < b) gcd(b, a);
  long r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
long lcm(long a, long b) {
  long c;
  c=gcd(a,b);
  return a*b/c;
}
long main() {
  long N, M;
  string S, T;
  cin>>N>>M;
  cin>>S>>T;
  long a,b,c;
  a=gcd(N,M);
  b=N/a;
  c=M/a;
  bool ok=true;
  for(long i=0;i<a;i++){
    if(S.at(i*b)!=T.at(i*c)){
      ok=false;
      break;
    }
  }
  if(ok){
    cout<<lcm(N,M)<<endl;
  }else{
    cout<<-1<<endl;
  }
}

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

#include <iostream>
#include <algorithm>
#include <string>


using namespace std;

int gcd(int a,int b){
    return b == 0? a : gcd(b,a%b);
}

const int main(){

    int N,M;cin >> N >> M;
    int L;
    int GCD = gcd(N,M);
    
    string A,B;
    cin >> A >> B;

    
    if(GCD == 1 && A[0]==B[0])L = M*N;
    else if (GCD == 1 && A[0] != B[0]) L = -1;



    cout << L;

} 

Compiler output:
a.cc:12:7: error: '::main' must return 'int'
   12 | const int main(){
      |       ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>


using namespace std;

int gcd(int a,int b){
    return b == 0? a : gcd(b,a%b);
}

const int main(){

    int N,M;cin >> N >> M;
    int L;
    int GCD = gcd(N,M);
    
    string A,B;
    cin >> A >> B;

    
    if(GCD == 1 && A[0]==B[0])L = MN;
    else if (GCD == 1 && A[0] != B[0]) L = -1;



    cout << L;

} 

Compiler output:
a.cc:12:7: error: '::main' must return 'int'
   12 | const int main(){
      |       ^~~
a.cc: In function 'int main()':
a.cc:22:35: error: 'MN' was not declared in this scope; did you mean 'M'?
   22 |     if(GCD == 1 && A[0]==B[0])L = MN;
      |                                   ^~
      |                                   M
Language: C++

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

//x<yとする
mod(int x,int y,bool a){
	if(y%x==0){
		if(a==false){
			return -1;
		}else{
			return x*y;
		}
	}else{
		mod(y,x,true);
	}
}

main(){
	int x,y;
	string a,b;
	cin >> x >> y;
	cin >> a;
	cin >> b;

	if(x<y){
		cout << mod(x,y,false) <<endl;
	}else{
		cout << mod(y,x,false) <<endl;
	}

}


Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'mod' with no type [-fpermissive]
    6 | mod(int x,int y,bool a){
      | ^~~
a.cc:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      | ^~~~
a.cc: In function 'int mod(int, int, bool)':
a.cc:14:20: warning: control reaches end of non-void function [-Wreturn-type]
   14 |                 mod(y,x,true);
      |                 ~~~^~~~~~~~~~
Language: C++

import math

N, M = map(int, input().split())
S = list(input())
T = list(input())

def main(N, M, S, T):
    result = N * M // math.gcd(N, M)
    cand = (result // N) * (result // M) // math.gcd((result // N), (result // M))
    for i in range(0, result // cand):
        if S[(i * cand + 3) // (result // N) - 1] != T[(i * cand + 3) // (result // M) - 1]:
            return -1
    return result
print(main(N, M, S, T))

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++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	string s,t;
	cin>>n>>m>>s>>t;
	if(s[0]!=t[o]){
		cout<<-1<<endl;
		return 0;
	}
	
	if(n%m!=0){
		if(m%n==0)cout<<-1<<endl;
		return 0;
	}
	if(n%m==0){
		cout<<-1<<endl;
		return 0;
	}
	for(int i=0;i<100000;i++){
		if(i%n==0){
			if(i%m==0){
				cout<<i<<endl;
				return 0;
			}
		}
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'o' was not declared in this scope
    7 |         if(s[0]!=t[o]){
      |                    ^
Language: C++

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

//x<yとする
mod(int x,int y,bool a){
	if(y%x==0){
		if(a==false){
			return -1;
		}else{
			return x*y;
		}
	}else{
		mod(y,x,true);
	}
}

main(){
	int x,y;
	string a;
	cin >> x >> y;
	cin >> a;
	cin >> b;

	if(x<y){
		cout << mod(x,y,false) <<endl;
	}else{
		cout << mod(y,x,false) <<endl;
	}

}


Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'mod' with no type [-fpermissive]
    6 | mod(int x,int y,bool a){
      | ^~~
a.cc:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:16: error: 'b' was not declared in this scope
   23 |         cin >> b;
      |                ^
a.cc: In function 'int mod(int, int, bool)':
a.cc:14:20: warning: control reaches end of non-void function [-Wreturn-type]
   14 |                 mod(y,x,true);
      |                 ~~~^~~~~~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS

/* include ***********************/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

/* define *************************/
//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
#define FOR(i,s,n) for(int i=(int)(s),i##_len=(int)(n);i<i##_len;i++)
#define RFOR(i,s,n) for(int i=(int)(s)-1,i##_len=(int)(n);i>=i##_len;i--)

//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTL(d) printf("%lld\n",(d))

//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))

#define INF 1e9
#define MOD 1000000007

typedef long long ll;
typedef unsigned long long ull;

int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};

int Min(int a, int b) {
	return (a)<(b) ? (a) : (b);
}
int  Max(int  a, int  b) {
	return (a) > (b) ? (a) : (b);
}
void Swap(int *a, int *b) {
	int tmp = *a;
	*a = *b;
	*b = tmp;
}void hSwap(int x[], int i, int j)
{
	int temp;

	temp = x[i];
	x[i] = x[j];
	x[j] = temp;
}

void ShowData(int x[], int left, int right)
{
	int i;
	for (i = left; i <= right; i++)printf("%d  ", x[i]);
	printf("\n");
}
void QSort(int x[], int left, int right, int n) {
	int i, j;	//左端,右端
	int pivot;	//軸

	i = left;
	j = right;
	pivot = x[(left + right) / 2];

	while (1) {
		if (n > 0) {				//n>0なら昇順、n<=0なら降順
			while ((x[i] < pivot) && (i <= right))i++;	//軸値より大きい要素
			while ((pivot < x[j]) && (i <= right))j--;	//軸値より小さい要素
		}
		else {
			while ((x[i] > pivot) && (i <= right))i++;	//軸値より小さい要素
			while ((pivot > x[j]) && (i <= right))j--;	//軸値より大きい要素
		}
		if (i >= j)	break;
		hSwap(x, i, j);
		i++; j--;
	}
	//ShowData(x, left, right);

	if (left < i - 1)QSort(x, left, i - 1, n);
	if (j + 1 <  right)QSort(x, j + 1, right, n);
}

int gcd(int a, int b) {
	if (b == 0)return a;
	int tmp = a%b;
	a = b;
	b = tmp;
	return gcd(a, b);
}

int main() {
	int n,m;
	scanf("%d%d", &n,&m);

	char s[100001], t[100001];
	scanf("%s", s);
	scanf("%s", t);
	if (s[0] != t[0]) {
		puts("-1");
		return 0;
	}

	int x = n / gcd(n, m)*m;
	if (n%m == 0){ 
		int l = max(n, m);
		REP(i, l) {
			if (s[l / n*i + 1] != t[l / n*i + 1]) {
				puts("-1");
				return 0;
			}
		}
	}
	PRINTD(x);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:25: error: 'max' was not declared in this scope; did you mean 'std::max'?
  114 |                 int l = max(n, m);
      |                         ^~~
      |                         std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: Java


public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int m = sc.nextInt();
        sc.nextLine();
        String first = sc.nextLine();
        String second = sc.nextLine();
        if (first.charAt(0) != second.charAt(0)) {
            System.out.println(-1);
            return;
        }
        final int lcm = lcm(n, m);


        final int result;
        if (n < m) {
            result = check(first, second, lcm);
        } else {
            result = check(second, first, lcm);
        }
        System.out.println(result);
    }

    private static int check(String a, String b, int lcm) {
        final int al = lcm / a.length();
        final int bl = lcm / b.length();
        for (int i = 0; i < a.length(); i++) {
            final char c1 = a.charAt(i);
            final int i1 = al * i;
            if (i1 % bl == 0 && b.charAt(i1 / bl) != c1) {
                return -1;
            }
        }
        return lcm;
    }

    private static int gcd(int a, int b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    private static int lcm(int a, int b) {
        return a * b / gcd(a, b);
    }
}


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

#include<bits/stdc++.h>
using namespace std;
int gcd(int m,int n){
  if(n)return gcd(n,m%n);
  return (m>0?m:-m);
}
main(){
  int n,m,l;
  string s;
  cin>>n>>m>>s>>s;
  l=a*b/gcd(n,m);
  cout<<((l!=n&&l!=m)?l:-1)<<endl;
}


Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'a' was not declared in this scope
   11 |   l=a*b/gcd(n,m);
      |     ^
a.cc:11:7: error: 'b' was not declared in this scope
   11 |   l=a*b/gcd(n,m);
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll main()
{
	ll a,b,i,j,k;
	string s1,s2;
	cin>>a>>b;
	ll l=__gcd(a,b);
	ll g=(a*b)/l;
	cin>>s1>>s2;
	if (g<=max(a,b)||s1[0]!=s2[0])
	cout<<-1<<endl;
	else
	cout<<g<<endl;
}

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

n, m = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

k = n * m // gcd(n, m)


for i in range(k, n * m + 1, k):
    ss = {a*(i//n) for a in range(n)}
    tt = {a*(i//m) for a in range(m)}
    st = ss & tt
    x = ''.join(S[c//(i//n)]for c in st)
    y = ''.join(T[c//(i//m)]for c in st)
    if x == y:
        print(i)
        exit()
print(-1)

Compiler output:
a.cc:17:9: error: empty character constant
   17 |     x = ''.join(S[c//(i//n)]for c in st)
      |         ^~
a.cc:18:9: error: empty character constant
   18 |     y = ''.join(T[c//(i//m)]for c in st)
      |         ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a;i < b; ++i)

signed main() {
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    int l = n * m / __gcd(n, m);
    rep(i, 0, n) {
        int pos = l/n*i;
        char c = s[i];
        if (pos * m % l == 0) {
            int j = pos * m / l;
            if (t[j] != s[i]) {
                    //cerr << j << ' ' << i << '\n';
                puts("-1");
                exit(0);
            }
        }
    }
    cout << l << '\n';
}
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a;i < b; ++i)

main() {
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    int l = n * m / __gcd(n, m);
    rep(i, 0, n) {
        int pos = l/n*i;
        char c = s[i];
        if (pos * m % l == 0) {
            int j = pos * m / l;
            if (t[j] != s[i]) {
                    //cerr << j << ' ' << i << '\n';
                puts("-1");
                exit(0);
            }
        }
    }
    cout << l << '\n';
}


Compiler output:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   30 | main() {
      | ^~~~
a.cc:30:1: error: redefinition of 'int main()'
a.cc:6:8: note: 'int main()' previously defined here
    6 | signed main() {
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a;i < b; ++i)

main() {
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    int l = n * m / __gcd(n, m);
    rep(i, 0, n) {
        int pos = l/n*i;
        char c = s[i];
        if (pos * m % l == 0) {
            int j = pos * m / l;
            if (t[j] != s[i]) {
                    //cerr << j << ' ' << i << '\n';
                puts("-1");
                exit(0);
            }
        }
    }
    cout << l << '\n';
}
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a;i < b; ++i)

main() {
    int n, m;
    string s, t;
    cin >> n >> m >> s >> t;
    int l = n * m / __gcd(n, m);
    rep(i, 0, n) {
        int pos = l/n*i;
        char c = s[i];
        if (pos * m % l == 0) {
            int j = pos * m / l;
            if (t[j] != s[i]) {
                    //cerr << j << ' ' << i << '\n';
                puts("-1");
                exit(0);
            }
        }
    }
    cout << l << '\n';
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main() {
      | ^~~~
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   30 | main() {
      | ^~~~
a.cc:30:1: error: redefinition of 'int main()'
a.cc:6:1: note: 'int main()' previously defined here
    6 | main() {
      | ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
long long lcm(lnog long a, long long b) {
	long long g = gcd(a, b);
	return a / g * b; //オーバーフローに注意
}

int main() {
    long long N, M;
    cin >> N >> M;

    string S, T;
    cin >> S >> T;

    long long A = lcm(N, M);
    long long B = lcm(A / N, A / M);
    bool flag = true;
    for (int i = 0; i < max(N, M); i += B) {
        if (S[i] != T[i]) {
            flag = false;
        }
    }

    if (flag) {
        cout << A << endl;
    }
    else {
        cout << "-1" << endl;
    }
}

Compiler output:
a.cc:7:15: error: 'lnog' was not declared in this scope; did you mean 'long'?
    7 | long long lcm(lnog long a, long long b) {
      |               ^~~~
      |               long
a.cc:7:28: error: expected primary-expression before 'long'
    7 | long long lcm(lnog long a, long long b) {
      |                            ^~~~
a.cc:7:39: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | long long lcm(lnog long a, long long b) {
      |                                       ^
a.cc: In function 'int main()':
a.cc:19:19: error: reference to 'lcm' is ambiguous
   19 |     long long A = lcm(N, M);
      |                   ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:7:11: note:                 'long long int lcm'
    7 | long long lcm(lnog long a, long long b) {
      |           ^~~
a.cc:20:19: error: reference to 'lcm' is ambiguous
   20 |     long long B = lcm(A / N, A / M);
      |                   ^~~
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:7:11: note:                 'long long int lcm'
    7 | long long lcm(lnog long a, long long b) {
      |           ^~~
Language: C++

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

const int maxn = 2e6;

long long n, m;
string s, t;

int main() {
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	cin >> s >> t;
	if(n == m) {
		if(s == t) cout << n;
		else cout << -1;
		return 0;
	}
	if(n % m == 0 || m % n == 0) {
		return cout << -1, 0;
	}
	assert(0);
	cout << (n * m) / __gcd(n, m);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'assert' was not declared in this scope
   24 |         assert(0);
      |         ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <algorithm>
  +++ |+#include <cassert>
    5 | using namespace std;
Language: C++

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

using namespace std;

#define vec vector
#define ALL(x) begin(x), end(x)

typedef unsigned int ui;
typedef long long ll;
typedef long double ld;
typedef pair< int, int > pii;
typedef pair< long long, long long > pll;

const int inf = 1000 * 1000 * 1000;
const ll inf64 = 1e18;

int main() {

#ifdef debug
    freopen("input.txt", "r", stdin);
#endif

    ios_base::sync_with_stdio(0);

    int n, m;
    string s, t;

    cin >> n >> m;
    cin >> s >> t;

    ll l = 1ll * n * m / __gcd(n, m);

    unordered_map< ll, char > mp;

    for(int i = 0;i < n;i++) {
        mp[(l/n) * i] = s[i];
    }

    for(int i = 0;i < m;i++) {
        ll ps = (l/m) * i;
        if(mp.count(ps) && mp[ps] != t[i]) {
            cout << "-1\n";
            return 0;
        }
    }

    cout << l << "\n";

    return 0;
}



Compiler output:
a.cc:2:10: fatal error: optimization.h: No such file or directory
    2 | #include "optimization.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<pii, int> ppiii;
typedef pair<ll, ll> pll;
typedef pair<pii, pii> query;
typedef pair<ll, pii> key;

ll facs[100005];
const int MOD = 1000000007;

ll modpow(ll b, ll e, ll m) {
  ll r = 1;
  while(e) {
    if(e%2) {
      r*=b;
      r%=m;
    }
    b*=b;
    b%=m;
    e/=2;
  }
  return r;
}

ll l[100005];
ll ifacsprefix[100005];
void solve() {
  int n;
  cin >> n;
  for(int i = 0; i < n; i++) cin >> l[i];
  facs[0] = 1;
  for(int i = 1; i <= n; i++) {
    facs[i] = i * facs[i-1];
    facs[i] %= MOD;
  }
  for(int i = 1; i <= n; i++) {
    ifacsprefix[i] = ifacsprefix[i-1] + modpow(i, MOD-2, MOD);
    ifacspreifx[i] %= MOD;
  }
  ll ret = 0;
  for(int i = 0; i < n; i++) {
    ret -= l[i];
    ret += ifacsprefix[n-i] * l[i];
    ret += ifacsprefix[i+1] * l[i];
    ret %= MOD;
  }
  ret += MOD;
  ret *= facs[n];
  cout << ret % MOD << "\n";
}

void casesolve() {
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << " ";
    solve();
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  // casesolve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:54:5: error: 'ifacspreifx' was not declared in this scope; did you mean 'ifacsprefix'?
   54 |     ifacspreifx[i] %= MOD;
      |     ^~~~~~~~~~~
      |     ifacsprefix
Language: C++

#include <bits/stdc++.h>
#define N 100010
#define P 1000000007
using namespace std;

int n;
long long a[N], inv[N], sum[N];

int main() {
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    sum[0] = 0, inv[1] = 1;
    for (int i = 1; i <= n; ++i) {
        if (i > 1) inv[i] = (P - P / i) * inv[P % i] % P;
        sum[i] = (sum[i - 1] + inv[i]) % P;
    }
    long long ret = 0, fact = 1;
    for (int i = 1; i <= n; ++i) 
        ret = (ret + (sum[i] + sum[n - i + 1] - 1) * a[i] % P, fact = fact * i % P;
    cout << ret * fact % P << endl;  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:83: error: expected ')' before ';' token
   19 |         ret = (ret + (sum[i] + sum[n - i + 1] - 1) * a[i] % P, fact = fact * i % P;
      |               ~                                                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
const ll MOD=1e9+7;

ll fc[100001]
ll f[100001];

ll add(ll x, ll y){return (x+y)%MOD;}
ll mlt(ll x, ll y){return (x*y)%MOD;}

ll power(int x, int n){
  ll v=1;
  while(n>0){
    if(n&1) v=mlt(v, x);
    x=mlt(x,x);
    n/=2;
  }
  return v;
}

ll inv(ll x){return power(x, MOD-2);}


int main(){
  int N;cin>>N;
  vll A;
  for (int i=0;i<N;++i){ll a;cin>>a;A.push_back(a);}

  fc[0]=1;

  for (int i=0;i<N;++i){
    fc[i+1]=mlt(fc[i], i+1);
  }

  for (int i=0;i<N;++i){
    f[i]=mlt(fc[i], inv(i+1));
  }

  ll ans=0;
  for (int i=0;i<N;++i){
    ll tmp=mlt(A[i], add(add(f[i],f[N-1-i]),1));
    ans=add(ans, tmp);
  }

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

Compiler output:
a.cc:8:1: error: expected initializer before 'll'
    8 | ll f[100001];
      | ^~
a.cc: In function 'int main()':
a.cc:31:3: error: 'fc' was not declared in this scope
   31 |   fc[0]=1;
      |   ^~
a.cc:38:5: error: 'f' was not declared in this scope
   38 |     f[i]=mlt(fc[i], inv(i+1));
      |     ^
a.cc:43:30: error: 'f' was not declared in this scope
   43 |     ll tmp=mlt(A[i], add(add(f[i],f[N-1-i]),1));
      |                              ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
vector[int] a(int x,int y){ 
vector<int> c[2]
if(y==0){
c[0]=1;
c[1]=0;
}
else{
int n = x/y ;
int m=x%y ;
vector<int> b[2];
b=a(y,m);
c[0]=b[1];
c[1]=b[0]-(b[1]*n)
}
return c;
}
int main(){
int x,y;
cin>>x>>y;
vector<int> c;
c=a(x,y);
cout<<c[0]<<" "<<c[1];
return 0;
}

Compiler output:
a.cc:6:8: error: expected identifier before 'int'
    6 | vector[int] a(int x,int y){
      |        ^~~
a.cc:6:8: error: expected ']' before 'int'
    6 | vector[int] a(int x,int y){
      |        ^~~
      |        ]
a.cc:6:7: error: empty structured binding declaration
    6 | vector[int] a(int x,int y){
      |       ^
a.cc:6:13: error: expected initializer before 'a'
    6 | vector[int] a(int x,int y){
      |             ^
a.cc: In function 'int main()':
a.cc:26:3: error: 'a' was not declared in this scope
   26 | c=a(x,y);
      |   ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
vector[int] a(int x,int y){ 
if(y==0){
return {1,0}
}
else{
int n = x/y ;
int m=x%y ;
vector<int> b[2];
b=a(y,m);
return {b[1],b[0]-(n*b[1])};
}
}
int main(){
int x,y;
cin>>x>>y;
vector<int> c;
c=a(x,y);
cout<<c[0]<<" "<<c[1]
}


Compiler output:
a.cc:6:8: error: expected identifier before 'int'
    6 | vector[int] a(int x,int y){
      |        ^~~
a.cc:6:8: error: expected ']' before 'int'
    6 | vector[int] a(int x,int y){
      |        ^~~
      |        ]
a.cc:6:7: error: empty structured binding declaration
    6 | vector[int] a(int x,int y){
      |       ^
a.cc:6:13: error: expected initializer before 'a'
    6 | vector[int] a(int x,int y){
      |             ^
a.cc: In function 'int main()':
a.cc:22:3: error: 'a' was not declared in this scope
   22 | c=a(x,y);
      |   ^
a.cc:23:22: error: expected ';' before '}' token
   23 | cout<<c[0]<<" "<<c[1]
      |                      ^
      |                      ;
   24 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}
#define ALL(a) (a).begin(), (a).end()
#define FOR(i, a, b) for (int i=(a);(i)<(b);(i)++)
#define REP(i, n) for (int i=0;(i)<(n);(i)++)
#define REPS(i, n) for (int i=1;(i)<=(n);(i)++)
#define RREP(i, n) for (int i=(x-1);(i)>=0;(i)--)
#define RREPS(i, n) for (int i=n;(i)>0;(i)--)
#define len(x) ((int)(x).size())
#define print(x) (cout<<(x)<<"\n")
#define MOD (1000000007)

int mod_inverse(int a, int m) {
    int x, y;
    extgcd(a, m, x, y);
    return (m + x%m) % m;
}

// test
// AGC028-B
signed main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    int n; cin>>n;
    vector<ll> a(n); REP(i, n) cin>>a[i];

    vector<ll> inv(n);
    REP(i, n) inv[i] = mod_inverse(i+1, MOD);
    FOR(i, 1, n) inv[i] += inv[i-1];

    ll ans = 0;
    REP(i, n) {
        ans += a[i] * (inv[i] + inv[n-i-1]) % MOD;
        ans %= MOD;
    }

    print(ans);
}

Compiler output:
a.cc: In function 'int mod_inverse(int, int)':
a.cc:20:5: error: 'extgcd' was not declared in this scope
   20 |     extgcd(a, m, x, y);
      |     ^~~~~~
Language: C++

#include<cstdio>
#include<algorithm>
#define rep(i,s,t) for(register int i=s;i<=t;++i)
using namespace std;
const int N=1e6+11,mod=1e9+7;
int n,ans,a[N],inv[N];
int main(){
	cin>>n;
	rep(i,1,n)
		cin>>a[i];
	inv[1]=1;
	rep(i,2,n)
		inv[i]=mod-1ll*mod/i*inv[mod%i]%mod;
	rep(i,2,n)
		inv[i]=(inv[i]+inv[i-1])%mod;
	rep(i,1,n)
		ans=(ans+1ll*(inv[i]+inv[n-i+1]-1)*a[i])%mod;
	rep(i,1,n)
		ans=1ll*ans*i%mod;
	ans=(ans+mod)%mod;
	cin>>ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
a.cc:9:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    9 |         rep(i,1,n)
      |             ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
a.cc:12:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         rep(i,2,n)
      |             ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
a.cc:14:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   14 |         rep(i,2,n)
      |             ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
a.cc:16:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         rep(i,1,n)
      |             ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
a.cc:18:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |         rep(i,1,n)
      |             ^
a.cc:3:37: note: in definition of macro 'rep'
    3 | #define rep(i,s,t) for(register int i=s;i<=t;++i)
      |                                     ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>
#include <list>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
#define dbgv(x) cout<<#x<<endl;reps(y,x){cout<<y<<" ";}cout<<endl

const long long MOD = 1000000007;
ll inv[10010];

void init_inv(){
  inv[1] = 1;
  FOR(i,2,n+1){
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
  }
}

inline ll mod(ll a) {
    return (a % MOD + MOD) % MOD;
}

int main(){
  ll n;cin>>n;
  vector<ll> a(n+1);
  FOR(i,1,n+1)cin>>a[i];
  init_inv()
  
  vector<ll> inv_sum(n+1);
  inv_sum[0]=0;
  FOR(i,1,n+1)inv_sum[i]=mod(inv_sum[i-1]+inv[i]);
  
  ll n_e=1;
  FOR(i,1,n+1)n_e=mod(n_e*i);

  ll ans=0;
  FOR(i,1,n+1){
    ans=mod(ans+mod(mod(n_e*mod(inv_sum[i]+inv_sum[n-i+1]-1))*a[i]));
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'void init_inv()':
a.cc:33:11: error: 'n' was not declared in this scope
   33 |   FOR(i,2,n+1){
      |           ^
a.cc:16:37: note: in definition of macro 'FOR'
   16 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
      |                                     ^
a.cc: In function 'int main()':
a.cc:46:13: error: expected ';' before 'vector'
   46 |   init_inv()
      |             ^
      |             ;
   47 | 
   48 |   vector<ll> inv_sum(n+1);
      |   ~~~~~~     
a.cc:49:3: error: 'inv_sum' was not declared in this scope
   49 |   inv_sum[0]=0;
      |   ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define mem(a,k) memset(a,k,sizeof(a))
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;

#define Pr(f,...) fprintf(stderr,f,##__VA_ARGS__),fflush(stderr)

typedef long long ll;

template<typename T>
void read(T &x){
	x=0; 
	char c;
	for(c=getchar();!isdigit(c);c=getchar()); 
	for(;isdigit(c);c=getchar())x=x*10+c-'0'; 
}

const int N=1e6+50,P=1e9+7;

int mul(int a,int b){ return 1ll*a*b%P; }
int add(int a,int b){ a+=b; return a>=P?a-P:a; }
int sub(int a,int b){ a-=b; return a<0?a+P:a; }
int gcd(int a,int b){ return !b?a:gcd(b,a%b); }

int n,m,f[N][N],s[N],ans,a[N]; 

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	freopen("d.in","r",stdin); 
#endif
	scanf("%d",&n); 
	rep(i,1,n)scanf("%d",a+i);
	s[1]=1; rep(i,2,n)s[i]=mul(P-P/i,s[P%i]); 
	rep(i,1,n)s[i]=add(s[i],s[i-1]); 
	rep(i,1,n)ans=add(ans,mul(sub(add(s[i],s[n-i+1]),1),a[i])); 
	rep(i,1,n)ans=mul(ans,i); 
	printf("%d\n",ans);
	return 0;
}

Compiler output:
/tmp/cc0DRUDj.o: in function `main':
a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x167): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x196): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x1c8): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x1df): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x200): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x232): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x252): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x269): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc0DRUDj.o
a.cc:(.text+0x292): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) FOR(i, n, 0);

int extGCD(int a, int b, int &x, int &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  int d = extGCD(b, a%b, y, x);
  y -= a / b * x;
  return d;
}

inline int mod(int a, int m) {
  return (a % m + m) % m;
}

int modinv(int a, int m) {
  int x, y;
  extGCD(a, m, x, y);
  return mod(x, m);
}

const int TMP = 1000000007;

vector<int> a;

signed main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;
  a.resize(n);
  REP(i, n) cin >> a[i];

  vector<int> s;
  int su = 0;
  REP(i, n) {
    su = su + modinv(i+1, TMP) % TMP;
    s.pb(su);
  }

  int ans = 0;
  REP(i, n) {
    ans = ans + ((a[i] * ((s[n-1-i] + s[i] - 1) % TMP) % TMP) % TMP;
  }

  REP(i, n) {
    ans = (ans * (i + 1)) % TMP;
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:68: error: expected ')' before ';' token
   54 |     ans = ans + ((a[i] * ((s[n-1-i] + s[i] - 1) % TMP) % TMP) % TMP;
      |                 ~                                                  ^
      |                                                                    )
Language: C++

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

int main(){
  int n ,A,s,t,u;
  cin >> n;
  A=0;
  vector<int> a(n);
  for (int i=0;i<n;i++){
    cin>>a.at(i);
  }
  for(int i =0;i<n;i++){//列
    //A = A+a.at(i)*(n-i)c(i)*(n-i)
    for(int j =1;j<=n-i;j++){
       s *= j;
    }
    for(int k =1;k<=i;k++){
      t *= k;
    }
    A = A+a.at(i)*s*(n-i)/(t+t);
  }
  cout << A%1000000007<<endl;
}

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

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

int main(){
  int n ,A,s,t,u;
  cin >> n;
  A=0
  vector<int> a(n);
  for (int i=0;i<n;i++){
    cin>>a.at(i);
  }
  for(int i =0;i<n;i++){//列
    //A = A+a.at(i)*(n-i)c(i)*(n-i)
    for(int j =1;j<=n-i;j++){
       s *= j;
    }
    for(int k =1;k<=i;k++){
      t *= k;
    }
    A = A+a.at(i)*s*(n-i)/(t+t);
  }
  cout << A%1000000007<<endl;
}

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

#include<iostream>
#define SIZE 100010
#define MOD 1000000007
using namespace std;
long N;
long A[SIZE];
long pattDiv[SIZE];
long pattDiv2[SIZE];
long i,j;
long sum;
int main(){
  cin >> N;
  for (i=1;i<=N;i++){
    cin >> A[i];
  }
  for (i=1;i<=N;i++){
    pattDiv[i]=1;
    pattDiv2[i]=2;
  }
  for (i=1;i<=N;i++){
    for (j=1;j<=N;j++){
      if (i!=j){
        pattDiv[j]*=i;
        pattDiv[j]%=MOD;
      }
      if (i!=j && i!=j-1){
        pattDiv2[j]*=i;
        pattDiv2[j]%=MOD;
      }
    }
  }

  sum=0;
  for (i=1;i<=N;i++){
    weight = 0;
    for (j=i;j<=N;j++){
      weight += A[j]
      if (i==1 && j==N){
        sum+=pattDiv[1]*weight;
        sum%=MOD;
      }
      else if (i==1 && j!=N){
        sum+=pattDiv[j-i+2]*weight;
        sum%=MOD;
      }
      else if (i!=1 && j==N){
        sum+=pattDiv[j-i+2]*weight;
        sum%=MOD;
      }
      else if (i!=1 && j!=N){
        sum+=pattDiv2[j-i+3]*weight;
        sum%=MOD;
      }
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'weight' was not declared in this scope
   35 |     weight = 0;
      |     ^~~~~~
a.cc:42:7: error: 'else' without a previous 'if'
   42 |       else if (i==1 && j!=N){
      |       ^~~~
Language: C++

#include<iostream>
#define SIZE 100010
#define MOD 1000000007
using namespace std;
long N;
long A[SIZE];
long pattDiv[SIZE];
long pattDiv2[SIZE];
long weight[SIZE][SIZE];
long i,j;
long sum;
int main(){
  cin >> N;
  for (i=1;i<=N;i++){
    cin >> A[i];
  }
  for (i=1;i<=N;i++){
    pattDiv[i]=1;
    pattDiv2[i]=2;
  }
  for (i=1;i<=N;i++){
    for (j=1;j<=N;j++){
      if (i!=j){
        pattDiv[j]*=i;
        pattDiv[j]%=MOD;
      }
      if (i!=j && i!=j-1){
        pattDiv2[j]*=i;
        pattDiv2[j]%=MOD;
      }
    }
  }
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==j){weight[i][j]=A[i];}
      else{weight[i][j]=0;}
    }
  }
  for (i=1;i<=N-1;i++){
    for (j=i+1;j<=N;j++){
        weight[i][j]=weight[i][j-1]+weight[j][j];
    }
  }
  sum=0;
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==1 && j==N){
        sum+=pattDiv[1]*weight[i][j];
        sum%=MOD;
      }
      else if (i==1 && j!=N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j==N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j!=N){
        sum+=pattDiv2[j-i+3]*weight[i][j];
        sum%=MOD;
      }
    }
  }
  cout << sum << endl;
}


Compiler output:
/tmp/ccXiUGco.o: in function `main':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x58): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x63): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0xa8): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccXiUGco.o
a.cc:(.text+0xd8): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define SIZE 100010
#define MOD 1000000007
long N;
long A[SIZE];
long pattDiv[SIZE];
long pattDiv2[SIZE];
long weight[SIZE][SIZE];
int i,j;
long sum;
int main(){
  cin >> N;
  for (i=1;i<=N;i++){
    cin >> A[i];
  }
  for (i=1;i<=N;i++){
    pattDiv[i]=1;
    pattDiv2[i]=2;
  }
  for (i=1;i<=N;i++){
    for (j=1;j<=N;j++){
      if (i!=j){
        pattDiv[j]*=i;
        pattDiv[j]%=MOD;
      }
      if (i!=j && i!=j-1){
        pattDiv2[j]*=i;
        pattDiv2[j]%=MOD;
      }
    }
  }
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==j){weight[i][j]=A[i];}
      else{weight[i][j]=0;}
    }
  }
  for (i=1;i<=N-1;i++){
    for (j=i+1;j<=N;j++){
        weight[i][j]=weight[i][j-1]+weight[j][j];
    }
  }
  sum=0;
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==1 && j==N){
        sum+=pattDiv[1]*weight[i][j];
        sum%=MOD;
      }
      else if (i==1 && j!=N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j==N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j!=N){
        sum+=pattDiv2[j-i+3]*weight[i][j];
        sum%=MOD;
      }
    }
  }
  cout << sum << endl;
}


Compiler output:
/tmp/ccBDEpd7.o: in function `main':
a.cc:(.text+0x1f): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0xa6): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0xc5): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0xce): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccBDEpd7.o
a.cc:(.text+0xd4): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define SIZE 100010
#define MOD 1000000007
long N;
long A[SIZE];
long pattDiv[SIZE];
long pattDiv2[SIZE];
long weight[SIZE][SIZE];
int i,j;
long sum;
int main(){
  cin >> N;
  for (i=1;i<=N;i++){
    cin >> A[i];
  }
  for (i=1;i<=N;i++){
    pattDiv[i]=1;
    pattDiv2[i]=2;
  }
  for (i=1;i<=N;i++){
    for (j=1;j<=N;j++){
      if (i!=j){
        pattDiv[j]*=i;
        pattDiv[j]%=MOD;
      }
      if (i!=j && i!=j-1){
        pattDiv2[j]*=i;
        pattDiv2[j]%=MOD;
      }
    }
  }
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==j){weight[i][j]=A[i];}
      else{weight[i][j]=0;}
    }
  }
  for (i=1;i<=N-1;i++){
    for (j=i+1;j<=N;j++){
        weight[i][j]=weight[i][j-1]+weight[j][j];
    }
  }
  sum=0;
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==1 && j==N){
        sum+=pattDiv[1]*weight[i][j];
        sum%=MOD;
      }
      else if (i==1 && j!=N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j==N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j!=N){
        sum+=pattDiv2[j-i+3]*weight[i][j];
        sum%=MOD;
      }
    }
  }
  cout << sum << endl;
}


Compiler output:
/tmp/ccdA0JeI.o: in function `main':
a.cc:(.text+0x1f): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0xa6): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0xc5): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0xce): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccdA0JeI.o
a.cc:(.text+0xd4): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define SIZE 100010
#define MOD 1000000007
long N;
long A[SIZE];
long pattDiv[SIZE];
long pattDiv2[SIZE];
long weight[SIZE][SIZE];
long i,j;
long sum;
int main(){
  cin >> N;
  for (i=1;i<=N;i++){
    cin >> A[i];
  }
  for (i=1;i<=N;i++){
    pattDiv[i]=1;
    pattDiv2[i]=2;
  }
  for (i=1;i<=N;i++){
    for (j=1;j<=N;j++){
      if (i!=j){
        pattDiv[j]*=i;
        pattDiv[j]%=MOD;
      }
      if (i!=j && i!=j-1){
        pattDiv2[j]*=i;
        pattDiv2[j]%=MOD;
      }
    }
  }
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==j){weight[i][j]=A[i];}
      else{weight[i][j]=0;}
    }
  }
  for (i=1;i<=N-1;i++){
    for (j=i+1;j<=N;j++){
        weight[i][j]=weight[i][j-1]+weight[j][j];
    }
  }
  sum=0;
  for (i=1;i<=N;i++){
    for (j=i;j<=N;j++){
      if (i==1 && j==N){
        sum+=pattDiv[1]*weight[i][j];
        sum%=MOD;
      }
      else if (i==1 && j!=N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j==N){
        sum+=pattDiv[j-i+2]*weight[i][j];
        sum%=MOD;
      }
      else if (i!=1 && j!=N){
        sum+=pattDiv2[j-i+3]*weight[i][j];
        sum%=MOD;
      }
    }
  }
  cout << sum << endl;
}

Compiler output:
/tmp/cce27omc.o: in function `main':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x58): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x63): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0xa8): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/cce27omc.o
a.cc:(.text+0xd8): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: Java

import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static Scanner s=new Scanner(System.in);

	static int mod=1000000007;
	
	static long nCr(int n,int r) {
		long res=1;
		for(int i=1;i<=r;++i) {
			res*=n-r+i;
			res/=i;
			res%=mod;
		}
		return res;
	}
	
	void solve(){
		int n=gInt();
		
		int[]a=new int[n];
		
		int fact[]=new int[n+1];
		fact[0]=1;
		for(int i=1;i<=n;++i) {
			fact[i]=(int)((long)i*fact[n-1]%mod);
		}
	}

	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	IntStream REP(int n){
		return REP(0,n-1);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
}
aaa

Compiler output:
Main.java:56: error: reached end of file while parsing
aaa
^
1 error