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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=100010;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  int n;
  cin>>n;
  int a[n];
  map<int> mp;
  int fi=-1,si=-1;
  REP(i,n){
    cin>>a[i];
    mp[a[i]++];
    if(mp[a[i]]==2){
      si=i;
    }
  }
  REP(i,n){
    if(a[i]==a[si]){
      fi=i;
      break;
    }
  }
  long long ans;
  long long sur=0;
  REPP(k,n+1){
    ans = comb(n+1,k);
    REP(i,k){
      if(i<=fi && k-1-i<=n-1-si){
        sur += mod(comb(fi,i)*comb(n-1-si,k-1-i));
      }
    }
    ans = mod(ans - sur);
    cout<<ans<<endl;
    sur = 0;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:10: error: wrong number of template arguments (1, should be at least 2)
   58 |   map<int> mp;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:62:7: error: invalid types 'int[int]' for array subscript
   62 |     mp[a[i]++];
      |       ^
a.cc:63:10: error: invalid types 'int[int]' for array subscript
   63 |     if(mp[a[i]]==2){
      |          ^
Language: C++

N = int(input())
L = [-1] * N
a = [int(i)-1 for i in input().split()]
for i in range(N+1):
    if L[a[i]] == -1:
        L[a[i]] = i
    else:
        x1, x2 = (min(L[a[i]], i), max(L[a[i]], i))
A = x1
B = x2-x1-1
C = N-x2

def power(a, b):
	if b == 0:
		return 1
	elif b == 1:
		return a % 1000000007
	elif b % 2 == 0:
		return (power(a, b//2) ** 2) % 1000000007
	else:
		return (power(a, b//2) ** 2 * a) % 1000000007
 
def divide(a, b):
	return (a * power(b, 1000000005)) % 1000000007


#階乗の逆元を求める
fac_lim = N
fac = [None]*(fac_lim+1)
fac[0] = 1
for i in range(fac_lim):
    fac[i+1] = fac[i] * (i+1)
    fac[i+1] = fac[i + 1] % 1000000007

fac_inv = [None]*(fac_lim+1)
fac_inv[fac_lim] = power(fac[fac_lim], 1000000005)
for i in range(fac_lim, 0, -1):
    fac_inv[i-1] = (fac_inv[i] * i)  % 1000000007

def conv(a, b):
    if a >= b:
        return (fac[a] * fac_inv[a-b] * fac_inv[b]) % 1000000007
    else:
        return 0

N1_conv = [0]*(N+2)
AC_conv = [0]*(N+2)
for i in range(N+2):
    N1_conv[i] = conv(N-1, i)
for i in range(N+2):
    AC_conv[i] = conv(A+C, i)
for K in range(1, N+2):
    ans = 0
    ans += N1_conv[K]
    if K>0:
        ans += AC_conv[K-1]
        ans += 2 * N1_conv[K-1]
        ans -= 2 * AC_conv[K-1]
    if K>1:
        ans += N1_conv[K-2]
    ans %= 1000000007
    print(ans)

Compiler output:
a.cc:27:2: error: invalid preprocessing directive #\U0000968e\U00004e57\U0000306e\U00009006\U00005143\U00003092\U00006c42\U00003081\U0000308b
   27 | #階乗の逆元を求める
      |  ^~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using tii = tuple<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define INF 1E9
#define LINF 1E18*5
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

template<class S, class T>ostream& operator<<(ostream&os, pair<S, T>p) { os << "[" << p.first << ", " << p.second << "]"; return os; };
template<class S>auto&operator<<(ostream&os, vector<S>t) { bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; } return os; }

//int dx[]={1,1,1,0,-1,-1,-1,0},dy[8]={1,0,-1,-1,-1,0,1,1,1};
//
constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

class compare {
public:
	bool operator()(tuple<int, int> a, tuple<int, int> b) {
		return (get<1>(a) < get<1>(b));
	}
};

vl fact(100002), finv(100002);

ll modpw(ll x, ll k) {
	ll res = 1;
	while (k != 0) {
		if (k & 1) res = res*x % MOD;
		x = x*x % MOD;
		k = k >> 1;
	}
	return res;
}

ll comb(ll n, ll k) {
	if (n == 0 && k == 0)return 1;
	if (n < k || n < 0)return 0;
	return fact[n] * finv[n - k] % MOD * finv[k] % MOD;;
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	ll n, d, fi = -1, se = 0;
	cin >> n;
	vl v(n), b(n + 1);
	fact[0] = 1;
	finv[0] = 1;
	rep (i,100001) {
		fact[i + 1] = (fact[i] * (i + 1)) % MOD;
		finv[i + 1] = modpw(fact[i + 1], MOD-2);
	}

	rep(i, n+1) {
		cin >> v[i];
		b[v[i]]++;
		if (b[v[i]] == 2)d = v[i];
	}
	rep(i, n+1) {
		if (v[i] == d) {
			if (fi == -1)fi = i + 1;
			else se = i + 1;
		}
	}
	rep(i, n + 1) {
		ll ans;
		ans = comb(n+1,i+1);
		if (i >= 0 && i <= tmp)ans = (ans + MOD - comb(tmp, i)) % MOD;
		printf("%lld\n", ans);
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:87:36: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   87 |                 if (i >= 0 && i <= tmp)ans = (ans + MOD - comb(tmp, i)) % MOD;
      |                                    ^~~
      |                                    tm
Language: C++

#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

// ARC077
int fact[MAX_N];
int ifact[MAX_N];
 
int power(int x, int n) {
	int res = 1LL;
	while (n > 0) {
		if (n & 1) (res *= x) %= MOD;
		(x *= x) %= MOD;
		n >>= 1;
	}
	return res % MOD;
}
 
int inv(int x) {
	return power(x, MOD - 2);
}
 
int nCr(int n, int r) {
	if (n < 0 || r < 0 || r > n) return 0;
	if (r > n / 2) r = n - r;
	return fact[n] * ifact[r] % MOD * ifact[n - r] % MOD;
}

signed main() {
  INIT;

	fact[0] = ifact[0] = 1;
	FOR(i, 1, MAX_N) {
		(fact[i] = fact[i - 1] * i) %= MOD;
		ifact[i] = inv(fact[i]);
	}
	
	VAR(int, n);
	VEC(int, a, n + 1);

	vector< int >  memo(MAX_N, -1);
	int lb = 0, ub = 0;
	REP(i, n + 1) {
		if (memo[a[i]] > -1) {
			lb = memo[a[i]];
			ub = i;
			break;
		}
		memo[a[i]] = i;
	}

	int ans = 0;
	REP(i, n + 1) {
		(ans = nCr(n + 1, i + 1) + ) %= MOD;
		(ans = ans - nCr(n - ub + lb, i) + MOD) %= MOD;
		(ans += MOD) %= MOD;
		OUT(ans)BR;
	}
	
	
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:44: error: expected primary-expression before ')' token
   83 |                 (ans = nCr(n + 1, i + 1) + ) %= MOD;
      |                                            ^
Language: C++

// D.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>

using namespace std;

typedef long long LL;

static const LL MOD = 1000000007;
static const size_t MAX_N = 100001;

struct modll {
	long long x;
	modll() { }
	modll(long long _x) : x(_x) { }
	operator int() const { return (int)x; }
	modll operator+(const modll &r) { return (x + r.x) % MOD; }
	modll operator+=(const modll &r) { return x = (x + r.x) % MOD; }
	modll operator-(const modll &r) { return (x + MOD - r.x) % MOD; }
	modll operator-=(const modll &r) { return x = (x + MOD - r.x) % MOD; }
	modll operator*(const modll &r) { return (x * r.x) % MOD; }
	modll operator*(int r) { return (x * r) % MOD; }
	modll operator*=(const modll &r) { return x = (x * r.x) % MOD; }
	static modll modinv(int a) { return modpow(a, MOD - 2); }
	static modll modpow(int a, int b) {
		modll x = a, r = 1;
		for (; b; b >>= 1, x *= x) if (b & 1) r *= x;
		return r;
	}
};

modll combination(LL n, LL r) {
	static modll fact[MAX_N + 1], inv[MAX_N + 1];
	if (!fact[0]) {
		fact[0] = 1;
		for (int i = 1; i <= MAX_N; ++i) {
			fact[i] = fact[i - 1] * i;
		}
		inv[MAX_N] = modll::modinv(fact[MAX_N]);
		for (int i = MAX_N; i >= 1; --i) {
			inv[i - 1] = inv[i] * i;
		}
	}
	return n >= r ? fact[n] * inv[r] * inv[n - r] : 0LL;
}

int main(int argc, char *argv[]) {
	int n, d;
	cin >> n;
	vector<int> pos(n + 1, -1);
	for (int i = 0; i <= n; ++i) {
		int a;
		cin >> a;
		if (pos[a] >= 0) {
			d = i - pos[a];
		}
		pos[a] = i;
	}
	for (int i = 1; i <= n + 1; ++i) {
		modll ans = combination(n + 1, i) - combination(n - d, i - 1);
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'modll combination(LL, LL)':
a.cc:47:23: error: operands to '?:' have different types 'modll' and 'long long int'
   47 |         return n >= r ? fact[n] * inv[r] * inv[n - r] : 0LL;
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:23: note:   and each type can be converted to the other
Language: C++

// D.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>

using namespace std;

typedef long long LL;

static const LL MOD = 1000000007;
static const size_t MAX_N = 100001;

struct modll {
	long long x;
	modll() { }
	modll(long long _x) : x(_x) { }
	operator int() const { return (int)x; }
	modll operator+(const modll &r) { return (x + r.x) % MOD; }
	modll operator+=(const modll &r) { return x = (x + r.x) % MOD; }
	modll operator-(const modll &r) { return (x + MOD - r.x) % MOD; }
	modll operator-=(const modll &r) { return x = (x + MOD - r.x) % MOD; }
	modll operator*(const modll &r) { return (x * r.x) % MOD; }
	modll operator*(int r) { return (x * r) % MOD; }
	modll operator*=(const modll &r) { return x = (x * r.x) % MOD; }
	static modll modinv(int a) { return modpow(a, MOD - 2); }
	static modll modpow(int a, int b) {
		modll x = a, r = 1;
		for (; b; b >>= 1, x *= x) if (b & 1) r *= x;
		return r;
	}
};

modll combination(LL n, LL r) {
	static modll fact[MAX_N + 1], inv[MAX_N + 1];
	if (!fact[0]) {
		fact[0] = 1;
		for (int i = 1; i <= MAX_N; ++i) {
			fact[i] = fact[i - 1] * i;
		}
		inv[MAX_N] = modll::modinv(fact[MAX_N]);
		for (int i = MAX_N; i >= 1; --i) {
			inv[i - 1] = inv[i] * i;
		}
	}
	return n >= r ? fact[n] * inv[r] * inv[n - r] : 0;
}

int main(int argc, char *argv[]) {
	int n, d;
	cin >> n;
	vector<int> pos(n + 1, -1);
	for (int i = 0; i <= n; ++i) {
		int a;
		cin >> a;
		if (pos[a] >= 0) {
			d = i - pos[a];
		}
		pos[a] = i;
	}
	for (int i = 1; i <= n + 1; ++i) {
		modll ans = combination(n + 1, i) - combination(n - d, i - 1);
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'modll combination(LL, LL)':
a.cc:47:23: error: operands to '?:' have different types 'modll' and 'int'
   47 |         return n >= r ? fact[n] * inv[r] * inv[n - r] : 0;
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:23: note:   and each type can be converted to the other
Language: C++

#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int fac[maxn];
int  inv[maxn];
int a[maxn];
int  n;
int  add;
int  fin[maxn];
int  id;
long long pow_mod(long long x)
{
    long long res = 1;
    long long n=mod-2;
    while (n)
    {
        if (n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
int C(int x, int y)
{
    return ((1ll * fac[x] * inv[y] )% mod * inv[x - y] )% mod;
}
void init()
{
    fac[0] = 1;
    fac[1] = 1;
    for (int i = 2; i <= n; i ++)
        fac[i] = (1ll * fac[i - 1] * i) % mod;
    inv[n] = pow_mod(fac[n]);
    for (int i = n - 1; i >= 0; i --)
        inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
}
void findd()
{
    for (int i = 1; i <= n; i ++)
    {
        if (fin[a[i]]!=0)
        {
            add = i;
            id = a[i];
            return
        }
        fin[a[i]] = i;
    }
}
int main()
{
    scanf("%d",&n);
    n++;
    for (int i = 1; i <= n; i ++)
        scanf("%d",&a[i]);
        init();
        findd();
    int com=n-add+fin[id]-1;
    for (int i = 1; i <= n; ++i)
    {
        int ans = C(n, i);
        if (i - 1 <= com)
            ans -= C(com, i - 1);
        printf("%d\n",(ans+mod)%mod);
    }
    return 0;
}


Compiler output:
a.cc: In function 'void findd()':
a.cc:47:9: error: expected primary-expression before '}' token
   47 |         }
      |         ^
a.cc:46:19: error: expected ';' before '}' token
   46 |             return
      |                   ^
      |                   ;
   47 |         }
      |         ~
Language: C++

#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(ll int i=a;i<=b;++i)
#define rep(i,n) for(ll int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
ll int MOD=1e9+7;
int INF=1e6;
ll int MAX_N=1e18;
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");

ll int inv[1000000]={};
void calc_inv(ll int n){
    inv[1]=1;
    rep2(i,2,n-1){
        inv[i]=(MOD-(MOD/i)*inv[MOD%i]%MOD);
    }
}

main(){
    ll int n;
    calc_inv(110000);
    cin>>n;
    ll int a[110000];
    int count[110000]={};
    ll int left,right;
    rep(i,n+1){
        scanf("%lld",&a[i]);
        if(!count[a[i]]) count[a[i]]=1;
        else right=i;
    }
    rep(i,n+1){
        if(a[i]==a[right]){ left=i; break;}
    }
    ll int comb1[110000],comb3[110000];
    comb1[0]=1,comb2[0]=1,comb3[0]=1;
    rep2(i,1,n+1){
        comb1[i]=comb1[i-1]*(n+1-i)%MOD;
        comb1[i]=comb1[i]*inv[i]%MOD;
        comb3[i]=comb3[i-1]*(n-right+left+1-i)%MOD;
        comb3[i]=comb3[i]*inv[i]%MOD;
        if(i>n-right+left) comb3[i]=0;
    }
    rep2(i,1,n+1){
        ll int ans=0;
        ans+=comb1[i];
        ans+=comb1[i-1];
        ans-=comb3[i-1];
        ans%=MOD;
        cout<<ans<<endl;         
    }
    return 0;
}

Compiler output:
a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   22 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:38:16: error: 'comb2' was not declared in this scope; did you mean 'comb3'?
   38 |     comb1[0]=1,comb2[0]=1,comb3[0]=1;
      |                ^~~~~
      |                comb3
Language: C++

#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(ll int i=a;i<=b;++i)
#define rep(i,n) for(ll int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
ll int MOD=1e9+7;
int INF=1e6;
ll int MAX_N=1e18;
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");

ll int inv[1000000]={};
void calc_inv(ll int n){
    inv[1]=1;
    rep2(i,2,n-1){
        inv[i]=(MOD-(MOD/i)*inv[MOD%i]%MOD);
    }
}

main(){
    ll int n;
    calc_inv(110000);
    cin>>n;
    ll int a[110000];
    int count[110000]={};
    ll int left,right;
    rep(i,n+1){
        scanf("%d",&a[i]);
        if(!count[a[i]]) count[a[i]]=1;
        else right=i;
    }
    rep(i,n+1){
        if(a[i]==a[right]){ left=i; break;}
    }
    ll int comb1[110000],comb3[110000];
    comb1[0]=1,comb2[0]=1,comb3[0]=1;
    rep2(i,1,n+1){
        comb1[i]=comb1[i-1]*(n+1-i)%MOD;
        comb1[i]=comb1[i]*inv[i]%MOD;
        comb3[i]=comb3[i-1]*(n-right+left+1-i)%MOD;
        comb3[i]=comb3[i]*inv[i]%MOD;
        if(i>n-right+left) comb3[i]=0;
    }
    rep2(i,1,n+1){
        ll int ans=0;
        ans+=comb1[i];
        ans+=comb1[i-1];
        ans-=comb3[i-1];
        ans%=MOD;
        cout<<ans<<endl;         
    }
    return 0;
}

Compiler output:
a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   22 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:38:16: error: 'comb2' was not declared in this scope; did you mean 'comb3'?
   38 |     comb1[0]=1,comb2[0]=1,comb3[0]=1;
      |                ^~~~~
      |                comb3
Language: Java


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

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n+1];
        long etc = (long)Math.pow(10, 9) + 7;
        for(int i=0;i<n+1;i++){
        	a[i] = sc.nextInt();
        }
        ArrayList<Point> list = new ArrayList<Point>();
        int[] judge = new int[n+1];
        long[] num = new long[n+2];
        num[0] = 1;
        long[] dnum = new long[n+2];
        dnum[0] = 1;
        Arrays.fill(judge, -1);
        int left = 0;
        int right = 0;
        for(int i=0;i<n+1;i++){
        	if(judge[a[i]] == -1){
        		judge[a[i]] = i;
        	}
        	else{
        		right = n-i;
        		left = judge[a[i]];
        	}
        }
        for(int i=1;i<=n+1;i++){
        	num[i] = num[i-1]*(n+2-(long)i);
        	//num[i] %= etc;
        	dnum[i] = dnum[i-1]*(long)i;
        	num[i] /= (long)i;
        	//dnum[i] %= etc;
        }
        long[] xnum = new long[right+left+1];
        long[] dxnum = new long[right+left+1];
        xnum[0] = 1;
        dxnum[0] = 1;
        for(int i=1;i<=left+right;i++){
        	xnum[i] = xnum[i-1]*((long)(right+left)+1-(long)i);
        	dxnum[i] = dxnum[i-1]*(long)i;
        	xnum[i] /= (long)i;
        	//xnum[i] %= etc;
        	//dxnum[i] %= etc;
        }

        for(int i=1;i<=n;i++){
        	long count = 1;

        	if(i==1){
        		count = n;
        	}
        	else{
        		int y = n+1;
        		count = num[i]/*dnum[i]*/;
        		if(right+left+1>=i){    			
	        		count -= xnum[i-1]/*dxnum[i-1]*/;
        		}
        	}

        	System.out.println(count%etc);
        }
        System.out.println(1);

    }
}


Compiler output:
Main.java:18: error: cannot find symbol
        ArrayList<Point> list = new ArrayList<Point>();
                  ^
  symbol:   class Point
  location: class Main
Main.java:18: error: cannot find symbol
        ArrayList<Point> list = new ArrayList<Point>();
                                              ^
  symbol:   class Point
  location: class Main
2 errors
Language: C++

#include <iostream>

int main(void) {
    # dummy comment
    cout << 0 << endl;
}

Compiler output:
a.cc:4:7: error: invalid preprocessing directive #dummy
    4 |     # dummy comment
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |     cout << 0 << endl;
      |     ^~~~
      |     std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |     cout << 0 << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<set>
#include <unordered_set>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP(i,n) for(int i=1;i<=signed(n);i++)
#define ALL(a) (a).begin(),(a).end()
using std::cout;
using std::vector;
using std::endl;
using std::cin;
using std::string;
using std::min;
using std::max;
//#define EVEL 1
#ifdef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const ll MOD = 1000000007;
const ll INF = 9e9;
typedef std::pair<int,int> P;
//struct edge {int to,cost;};
#define VMAX 200+10
    ll N,A[100010];
    ll F[100010];
    ll l,r;
    ll ans;

ll Fact[100010];
ll Com[100010];
void FC(ll x){
    Fact[0]=Com[0]=1;
    ll temp=1;
    EREP(i,x){
        temp=temp*i%MOD;
        Fact[i]=temp;
        Com[i]=LP(temp,MOD-2);
    }
}
ll MC(ll x,ll y){
    if(y==0)return 1;
    if(x<y)return 0;
    return (Fact[x]*((Com[y]*Com[x-y])%MOD))%MOD;
}

int main(){
    std::ios_base::sync_with_stdio(false);
    cin>>N;
    REP(i,100010)F[i]=-1;
    REP(i,N+1){
        cin>>A[i];
        if(F[A[i]]==-1)F[A[i]]=i;
        else{
            l=F[A[i]];
            r=i;
        }
    }
    FC(N+2);
    REP(i,N+1){
        DEB(MC(N+1,i+1))DEB(MC(l+N-r,i))END
    cout<<MC(N+1,i+1)-MC(l+N-r,i)<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'void FC(ll)':
a.cc:54:16: error: 'LP' was not declared in this scope; did you mean 'P'?
   54 |         Com[i]=LP(temp,MOD-2);
      |                ^~
      |                P
Language: C++

#include <iostream>
using namespace std;

#define MOD 1000000007

long long mod(long long x, int n) {
    //cout << x << endl;
    if(n == 0) return 1;
    long long ret = mod(x * x % MOD, n / 2);
    if(n % 2) ret = ret * x % MOD;
    return ret;
}

long long p(long long l, long long r) {
    //cout << "mod: " <<  l * mod(r, MOD - 2) % MOD << endl;
    if(r < 0) return 0;
    if(r == 0) return 1;
    return l * mod(r, MOD - 2) % MOD;
}

int main() {

    int n, idx;
    int a[100001], used[100001] = {0};

    cin >> n;
    for(int i = 0; i <= n; i++) {
        cin >> a[i];
        used[a[i]]++;
    }
    int *pp = max_element(used, used + n + 1);
    for(idx = n; a[idx] != pp - used; idx--);

    long long del = n - idx + 1;
    long long l = n + 1, r = 1;
    for(int i = 1; i <= n + 1; i++) {
        //cout << l << "C" << r << " - " << del << "C" << i - 1 << " = " << p(l, r) << " - " << delp(del, i - 1) << endl;
        cout << (p(l, r) - (del < i - 1 ? 0 : p(del, i - 1)) + MOD) % MOD << endl;
        l = l * (n + 1 - i) % MOD;
        r = r * (i + 1) % MOD;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'max_element' was not declared in this scope
   31 |     int *pp = max_element(used, used + n + 1);
      |               ^~~~~~~~~~~
Language: C++

#include<cstdio>
#include<algorithm>
 
using namespace std;
 
#define  N 300005
#define Mo 1000000007
 
int i,jm,n,p,k,inv[N],fac[N];
 
int C(int x,int y)
{
     if (x<y) return 0;
     return 1ll*fac[x]*inv[y]%Mo*inv[x-y]%Mo;
}

int power(int x,int y)
{

}
 
int main()
{
           scanf("%d",&n);
           fac[0]=1;
           for (i=1;i<N;++i) fac[i]=1ll*fac[i-1]*i%Mo;
           for (i=0;i<N;++i) inv[i]=power(fac[i],Mo-2);
           for (i=1;i<=n+1;++i) 
           {
                   scanf("%d",&k);
                   if (vis[k]) len=k-vis[k]+1;
                   vis[k]=i;
           }
           for (i=1;i<=n+1;++i) printf("%d\n",(C(n+1,i)-C(n+1-len,i-1)+Mo)%Mo);
}

Compiler output:
a.cc: In function 'int power(int, int)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:31:24: error: 'vis' was not declared in this scope
   31 |                    if (vis[k]) len=k-vis[k]+1;
      |                        ^~~
a.cc:31:32: error: 'len' was not declared in this scope
   31 |                    if (vis[k]) len=k-vis[k]+1;
      |                                ^~~
a.cc:32:20: error: 'vis' was not declared in this scope
   32 |                    vis[k]=i;
      |                    ^~~
a.cc:34:63: error: 'len' was not declared in this scope
   34 |            for (i=1;i<=n+1;++i) printf("%d\n",(C(n+1,i)-C(n+1-len,i-1)+Mo)%Mo);
      |                                                               ^~~
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

#define  N 300005
#define Mo 1000000007

int i,jm,n,p,k,inv[N],fac[N];

int C(int x,int y)
{
     if (x<y) return 0;
     return 1ll*fac[x]*inv[y]%Mo*inv[x-y]%Mo;
}

int main()
{
           scanf("%d",&n);
           fac[0]=1;
           for (i=1;i<N;++i) fac[i]=1ll*fac[i-1]*i%Mo;
           for (i=0;i<N;++i) inv[i]=power(fac[i],Mo-2);
           for (i=1;i<=n+1;++i) 
           {
                   scanf("%d",&k);
                   if (vis[k]) len=k-vis[k]+1;
                   vis[k]=i;
           }
           for (i=1;i<=n+1;++i) printf("%d\n",(C(n+1,i)-C(n+1-len,i-1)+Mo)%Mo);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: 'power' was not declared in this scope
   22 |            for (i=0;i<N;++i) inv[i]=power(fac[i],Mo-2);
      |                                     ^~~~~
a.cc:26:24: error: 'vis' was not declared in this scope
   26 |                    if (vis[k]) len=k-vis[k]+1;
      |                        ^~~
a.cc:26:32: error: 'len' was not declared in this scope
   26 |                    if (vis[k]) len=k-vis[k]+1;
      |                                ^~~
a.cc:27:20: error: 'vis' was not declared in this scope
   27 |                    vis[k]=i;
      |                    ^~~
a.cc:29:63: error: 'len' was not declared in this scope
   29 |            for (i=1;i<=n+1;++i) printf("%d\n",(C(n+1,i)-C(n+1-len,i-1)+Mo)%Mo);
      |                                                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007LL;
bool b[100001] = { false };
int num[100001];
LL fact[100001];
LL inv[100001];
LL inv_fact[100001];
LL mod_pow(LL x, LL a) {
	if (a == 0) return 1;
	if (a % 2 == 0) {
		LL ret = mod_pow(x, a / 2);
		return (ret*ret) % MOD;
	}
	else {
		return (x*mod_pow(x, a - 1)) % MOD;
	}
}
LL comb(LL n, LL k) {
	if (n < k) return 0;
	LL ans = (fact[n] * inv_fact[k]) % MOD;
	ans = (ans*inv_fact[n - k]) % MOD;
	return ans;
}
int main() {
	int n, dup[2];
	cin >> n;
	for (int i = 0; i <= n; i++) {
		int a;
		cin >> a;
		num[i] = a;
		if (!b[a - 1])b[a - 1] = true;
		else {
			dup[1] = i;
			break;
		}
	}
	for (int i = 0; i<dup[1]; i++) {
		if (num[i] == num[dup[1]])dup[0] = i;
	}
	fact[0] = 1;
	inv_fact[0] = 1;
	for (int i = 1; i<n + 1; i++) {
		inv[i] = mod_pow(i, MOD - 2);
		fact[i] = (fact[i - 1] * i) % MOD;
		inv_fact[i] = (inv_fact[i - 1] * inv[i]) % MOD;
	}
	int cen = dup[1] - dup[0] - 1;
	cout << n << endl;
	for (int i = 2; i <= n + 1; i++) {
		LL sum = 0;
		sum = (sum + comb(n - 1, i)) % MOD;
		sum = (sum + comb(n - 1, i - 2)) % MOD;
		sum = (sum + 2 * comb(n - 1, i - 1)) % MOD;
		sum = (sum - comb(n - cen - 1, i - 1) + MOD) % MOD;
		cout << sum << endl;
	}

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


#include<bits/stdc++.h>

using namespace std;

typedef unsigned long long ll;


ll mo=1000000007;
ll combi(ll N_, ll C_) {
	const int NUM_=400001;
	static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];
	if (fact[0]==0) {
		inv[1]=fact[0]=factr[0]=1;
		for (int i=2;i<=NUM_;++i) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
		for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%mo, factr[i]=factr[i-1]*inv[i]%mo;
	}
	if(C_<0 || C_>N_) return 0;
	return factr[C_]*fact[N_]%mo*factr[N_-C_]%mo;
}

int N;
int A[101010];
int num[101010];
vector<int> V;
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N+1) {
		cin>>A[i];
		num[A[i]]++;
	}
	FOR(i,N+1) if(num[A[i]]==2) V.push_back(i);
	int a=V[0];
	int b=V[1]-V[0]-1;
	int c=N-V[1];
	for(i=1;i<=N+1;i++) {
		if(i==1) {
			cout<<N<<endl;
			continue;
		}
		ll ret=0;
		// D=0
		ret += combi(N-1,i);
		// D=1
		ret += combi(a+c,i-1);
		ret += (combi(a+c+b,i-1)-combi(a+c,i-1))*2;
		
		// D=2
		ret += combi(N-1,i-2);
		
		cout<<(ret%mo+mo)%mo<<endl;
		
	}
	
	
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:9: error: 'FOR' was not declared in this scope
   30 |         FOR(i,N+1) {
      |         ^~~
Language: C++

ll mo=1000000007;
ll combi(ll N_, ll C_) {
	const int NUM_=400001;
	static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];
	if (fact[0]==0) {
		inv[1]=fact[0]=factr[0]=1;
		for (int i=2;i<=NUM_;++i) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
		for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%mo, factr[i]=factr[i-1]*inv[i]%mo;
	}
	if(C_<0 || C_>N_) return 0;
	return factr[C_]*fact[N_]%mo*factr[N_-C_]%mo;
}

int N;
int A[101010];
int num[101010];
vector<int> V;
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N+1) {
		cin>>A[i];
		num[A[i]]++;
	}
	FOR(i,N+1) if(num[A[i]]==2) V.push_back(i);
	int a=V[0];
	int b=V[1]-V[0]-1;
	int c=N-V[1];
	for(i=1;i<=N+1;i++) {
		if(i==1) {
			cout<<N<<endl;
			continue;
		}
		ll ret=0;
		// D=0
		ret += combi(N-1,i);
		// D=1
		ret += combi(a+c,i-1);
		ret += (combi(a+c+b,i-1)-combi(a+c,i-1))*2;
		
		// D=2
		ret += combi(N-1,i-2);
		
		cout<<(ret%mo+mo)%mo<<endl;
		
	}
	
	
}

Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll mo=1000000007;
      | ^~
a.cc:2:1: error: 'll' does not name a type
    2 | ll combi(ll N_, ll C_) {
      | ^~
a.cc:17:1: error: 'vector' does not name a type
   17 | vector<int> V;
      | ^~~~~~
a.cc: In function 'void solve()':
a.cc:19:28: error: 'string' was not declared in this scope
   19 |         int i,j,k,l,r,x,y; string s;
      |                            ^~~~~~
a.cc:21:9: error: 'cin' was not declared in this scope
   21 |         cin>>N;
      |         ^~~
a.cc:22:9: error: 'FOR' was not declared in this scope
   22 |         FOR(i,N+1) {
      |         ^~~
a.cc:27:15: error: 'V' was not declared in this scope
   27 |         int a=V[0];
      |               ^
a.cc:32:25: error: 'cout' was not declared in this scope
   32 |                         cout<<N<<endl;
      |                         ^~~~
a.cc:32:34: error: 'endl' was not declared in this scope
   32 |                         cout<<N<<endl;
      |                                  ^~~~
a.cc:35:17: error: 'll' was not declared in this scope; did you mean 'l'?
   35 |                 ll ret=0;
      |                 ^~
      |                 l
a.cc:37:17: error: 'ret' was not declared in this scope
   37 |                 ret += combi(N-1,i);
      |                 ^~~
a.cc:37:24: error: 'combi' was not declared in this scope
   37 |                 ret += combi(N-1,i);
      |                        ^~~~~
a.cc:45:17: error: 'cout' was not declared in this scope
   45 |                 cout<<(ret%mo+mo)%mo<<endl;
      |                 ^~~~
a.cc:45:28: error: 'mo' was not declared in this scope
   45 |                 cout<<(ret%mo+mo)%mo<<endl;
      |                            ^~
a.cc:45:39: error: 'endl' was not declared in this scope
   45 |                 cout<<(ret%mo+mo)%mo<<endl;
      |                                       ^~~~
Language: C++

#include<iostream>
#include<cmath>
	
using namespace std;
	
long long n; 
long long a[100010];
int use[100010];
long long jl[100000];
int check;
long long mod=1000000007;
	
long long C(int a,int b) 
{   
	b=min(b,n+1-b);
	if(a==n+1&&jl[b]!=0) return jl[b];
	
	long long x=1;
	if(a==n) 
	{ 
		x=jl[b-1]*(a-b+1)/(b)%mod;  
		jl[b]=x;
		return x;
	} 
	for(int i=0;i<b;i++)  
		x=x*(a-i)/(i+1); 
//if(b==16) cout<<a-i<<" "<<i+1<<" "<<x<<" "; 
	x%=mod;
	if(a==n+1&&jl[b]==0) jl[a]=x;
//cout<<mul(a,b)<<" "<<mul(b,b)<<" ";
	return x;
}   
	
int main() 
{	
	scanf("%d",&n);
	int num,same1=0,same2=0; 
	for(int i=1;i<=n+1;i++)
	{ 
		scanf("%d",&a[i]);
		if(use[a[i]]!=0)same1=use[a[i]],same2=i;
		use[a[i]]=i;
	} 
//cout<<same1<<' '<<same2<<' ';
		
	check=same1+n-same2;
//cout<<check;  
	jl[1]=n+1;
	for(int i=1;i<=n+1;i++)
	{
		long long x=C(n+1,i);
		long long y=0;
		if(i<=check+1) y=C(check,i-1);
//cout<<x<<y<<" ";
		printf("%lld\n",x-y);
	}
}	
	
/*	
32	
29 19 7 10 26 32 27 4 11 20 2 8 16 23 5 14 6 12 17 22 18 30 28 24 15 1 25 3 13 21 19 31 9
*/	

Compiler output:
a.cc: In function 'long long int C(int, int)':
a.cc:15:14: error: no matching function for call to 'min(int&, long long int)'
   15 |         b=min(b,n+1-b);
      |           ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:15:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   15 |         b=min(b,n+1-b);
      |           ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <cassert>
#include <cstdio>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i))
using ll = long long;
using namespace std;

ll powmod(ll x, ll y, ll p) { // O(log y)
    assert (0 <= x and x < p);
    assert (0 <= y);
    ll z = 1;
    for (ll i = 1; i <= y; i <<= 1) {
        if (y & i) z = z * x % p;
        x = x * x % p;
    }
    return z;
}
ll inv(ll x, ll p) { // p must be a prime, O(log p)
    assert ((x % p + p) % p != 0);
    return powmod(x, p-2, p);
}
constexpr int mod = 1e9+7;
int fact(int n) {
    static vector<int> memo(1, 1);
    if (memo.size() <= n) {
        int l = memo.size();
        memo.resize(n+1);
        repeat_from (i, l, n+1) memo[i] = memo[i-1] *(ll) i % mod;
    }
    return memo[n];
}
int choose(int n, int r) { // O(n) at first time, otherwise O(\log n)
    if (n < r) return 0;
    r = min(r, n - r);
    return fact(n) *(ll) inv(fact(n-r), mod) % mod *(ll) inv(fact(r), mod) % mod;
}

int main() {
    // input
    int n; scanf("%d", &n);
    vector<int> a(n + 1); repeat (i, n + 1) scanf("%d", &a[i]);
    // solve
    int dup[2]; {
        vector<int> used(n, -1);
        repeat (i, n + 1) {
            if (used[a[i] - 1] != -1) {
                dup[0] = used[a[i] - 1];
                dup[1] = i;
                break;
            }
            used[a[i] - 1] = i;
        }
    }
    int l = dup[0];
    int m = dup[1] - (dup[0] + 1);
    int r = n + 1 - (dup[1] + 1);
    repeat_from (k, 1, n + 2) {
        ll result = choose(n + 1, k) - choose(l + r, k - 1);
        retult = (result + mod) % mod;
        printf("%lld\n", result);
    }
    return 0;
}


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

#include <iostream>
#include <vector>
using namespace std;
typedef unsigned long long u64;
typedef signed long long l64;

u64 binpow(u64 n, u64 x, u64 mod)
{
  u64 tgt = 1;
  u64 dig = n;
  while (x > 0) {
    if (x%2) {
      tgt = (tgt * dig) % mod;
    }
    dig = (dig * dig) % mod;
    x /= 2;
  }
  return tgt;
}

class Comb
{
public:
  u64 mod; // 10e9+7
  vector< u64 > fact;
  vector< u64 > factf;
  void init(u64 size, u64 imod) {
    mod = imod;
    fact.resize(size);
    factf.resize(size);
    fact[0] = 1;
    factf[0] = 1;
    for (u64 i = 1; i <= size; ++i) {
      fact[i] = fact[i-1]*i%mod;
      factf[i] = binpow(fact[i], mod-2, mod);
    }
  }
  u64 comb(u64 n, u64 k) {
    if (n<k) return 0;
    if (n<0) return 0;
    if (k==0) return 1;
    return (fact[n] * factf[k] * factf[n-k]) % mod;
  }
};

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  Comb comb;
  comb.init(1e5, 1e9+7);
  int n;
  cin >> n;
  l64 a[n+1];
  for (u64 i = 1; i <= n; ++i) {
    a[i] = -1;
  }
  u64 a1, a2;
  for (u64 i = 0; i <= n; ++i) {
    u64 ai;
    cin >> ai;
    if (a[ai] >= 0) {
      a1 = a[ai];
      a2 = i;
      break;
    }
    a[ai] = i;
  }
  for (u64 i = 1; i <= n+1; ++i) {
    u64 up = comb.comb(n+1, i);
    u64 dn = comb.comb(n-1-(a2-a1-1), i-1);
    if (up>dn) return (up-dn)%(1e9+7);
    else return (up+1e9+7-dn)%(1e9+7);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:30: error: invalid operands of types 'u64' {aka 'long long unsigned int'} and 'double' to binary 'operator%'
   72 |     if (up>dn) return (up-dn)%(1e9+7);
      |                       ~~~~~~~^~~~~~~~
      |                          |        |
      |                          |        double
      |                          u64 {aka long long unsigned int}
a.cc:73:30: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   73 |     else return (up+1e9+7-dn)%(1e9+7);
      |                 ~~~~~~~~~~~~~^~~~~~~~
      |                          |        |
      |                          double   double
Language: C++

//15:53-17:33
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define mod 1000000007
ll modpow(ll x,ll n)
{
	ll res=1;
	while(n>0)
	{
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[300005],R[300005];
void make(){
	F[0] = 1;
	for(int i=1;i<300005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<300005;i++) R[i] = modpow(F[i],mod-2);
}
int n,a[100005],pos[100005];
ll C(int a,int b){ return F[a]*R[b]%mod*R[a-b]%mod;}
int main(){
	cin >> n;
	int x;a
	for(int i=1;i<=n+1;i++){
		cin >> a[i];
		if(!pos[a[i]]) pos[a[i]] = i;
		else{
			x = i+1-pos[a[i]];
		}
	}
	make();
	for(int k=1;k<=n+1;k++){
		ll ret = 0;
		//0
		if(n-1 >= k) ret += C(n-1,k);
		//1
		if(n-1 >= k-1) ret += 2LL*C(n-1,k-1);
		if(n+1-x >= k-1) ret -= C(n+1-x,k-1);
		//2
		if(n-1 >= k-2 && k != 1) ret += C(n-1,k-2);
		ret = (ret%mod+mod)%mod;
		cout << ret << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:16: error: expected ';' before 'for'
   42 |         int x;a
      |                ^
      |                ;
   43 |         for(int i=1;i<=n+1;i++){
      |         ~~~     
a.cc:43:21: error: 'i' was not declared in this scope
   43 |         for(int i=1;i<=n+1;i++){
      |                     ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <utility>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define LL long long
#define ll long long
#define Pair pair<int,int>
#define LOWBIT(x) x & (-x)
using namespace std;

const LL MOD=1e9+7;
const int INF=0x7ffffff;
const int magic=348;

int n;
LL id1,id2;
LL a[100048];
int v[100048];
int cnt[100048];

LL fac[100048],finv[100048],inv[100048];

void make()
{
	fac[0]=fac[1]=1;
	finv[0]=finv[1]=1;
	inv[1]=1;
	for(int i=2;i<100010;i++)
	{
		inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
		fac[i]=fac[i-1]* i%MOD;
		finv[i]=finv[i-1]*inv[i]%MOD;
	}
}
ll C(int x,int y)
{
	if(x<y) return 0;
	return fac[x]*(finv[y]*finv[x-y]%MOD)%MOD;
}

int main ()
{
	LL i;
	cin>>n;
	memset(cnt,0,sizeof(cnt));
	for (i=1;i<=n+1;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}
	p=p1=0;
	for (i=1;i<=n+1;i++)
		if (cnt[a[i]]==2)
			if (p1==0) p1=i; else p=i;
	memset(a, 0, sizeof(a));
    memset(v, 0, sizeof(v));
    for(ll i = 1; i <= n + 1; ++i){
        cin >> a[i];
        v[a[i]]++;
    }
    for(ll i = 1; i <= n + 1; ++i){
        if(v[a[i]] == 2 && !id1){
            id1 = i;
        }
        else if(v[a[i]] == 2) {
            id2 = i;
        }
    }
	LL ans;
	make();
	for (i=0;i<=n;i++)
	{
		ans=C(n+1,i+1);
		ans-=C(n-p+p1,i);
		if (ans<0) ans+=MOD;
		printf("%d\n",ans);	
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:9: error: 'p' was not declared in this scope
   65 |         p=p1=0;
      |         ^
a.cc:65:11: error: 'p1' was not declared in this scope; did you mean 'y1'?
   65 |         p=p1=0;
      |           ^~
      |           y1
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ls rt << 1
#define rs rt << 1 | 1
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
const int N = 1e5 + 10;
const ll mod = 1e9 + 7;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}

	 id[N];
ll jc[N], ny[N];

ll qpow(ll a, ll x)
{
	if(x == 1) return a % mod;
	ll now = (qpow(a, x / 2) % mod);
	if(x % 2 == 1) return ((now * a % mod) * now % mod);
	else return (now * now % mod);
}

ll C(int a, int b)
{
	if(a < b) return 0;
	return (((jc[a] * ny[b] % mod) * ny[a - b]) % mod);
}

int main()
{
	jc[0] = 1;
	jc[1] = 1;
	for(int i = 2; i <= 1e5; i ++)
		jc[i] = jc[i - 1] * i, jc[i] = jc[i] % mod;
	ny[0] = 1;
	ny[1] = 1;
	for(int i = 2; i <= 1e5; i ++)
		ny[i] = qpow(jc[i], mod - 2);
	//for(int i = 1; i <= 10; i ++)
		//cout << jc[i] << " " << ny[i] << endl;
	int n = read();
	memset(id, -1, sizeof(id));
	int s, t;
	for(int i = 0; i <= n; i ++)
	{
		int x = read();
		x --;
		if(id[x] == -1) id[x] = i;
		else s = id[x], t = i;
	}
	//cout << s << " " << t << endl;
	//cout << C(5, 3) << " ";
	for(int i = 1; i <= n + 1; i ++)
	{
		ll ret = C(n + 1, i) % mod;
		ret = ret - C(s + (n - t), i - 1);
		ret %= mod;
		if(ret < 0) ret += mod;
		printf("%lld\n",ret);
	}
	
	return 0;
}

Compiler output:
a.cc:22:10: error: 'id' does not name a type; did you mean 'void'?
   22 |          id[N];
      |          ^~
      |          void
a.cc: In function 'int main()':
a.cc:52:16: error: 'id' was not declared in this scope
   52 |         memset(id, -1, sizeof(id));
      |                ^~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ls rt << 1
#define rs rt << 1 | 1
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}

int id[N];
ll jc[N], ny[N];

ll qpow(ll a, int x)
{
	if(x == 1) return a;
	ll now = qpow(a, x / 2);
	if(x % 2 == 1) return now * now % mod * a % mod;
	else return now * now % mod;
}

ll C(int a, int b)
{
	if(a < b) return 0;
	return (((jc[a] * ny[b] % mod) * ny[a - b]) % mod);
}

int main()
{
	jc[0] = 1;
	for(int i = 1; i <= 1e5; i ++)
		jc[i] = jc[i - 1] * i, jc[i] = jc[i] % mod;
	ny[0] = 1;
	for(int i = 1; i <= 1e5; i ++)
		ny[i] = qpow(jc[i], mod - 2);
	//for(int i = 1; i <= 10; i ++)
	//	cout << jc[i] << " " << ny[i] << endl;
	int n = read();
	memset(id, -1, sizeof(id));
	int s, t;
	for(int i = 0; i <= n; i ++)
	{
		int a = read();
		a --;
		if(id[a] == -1) id[a] = i;
		else
		{
			s = id[a];
			t = i;
		}
	}
	//cout << s << " " << t << endl;
	//cout << C(5, 3) << " ";
	for(int i = 1; i <= n + 1; i ++)
	{
		ll ret = C(n + 1, i), C(s + (n - t), i - 1);
		if(ret < 0) ret += mod;
		printf("%lld\n",ret);
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:59: error: expression list treated as compound expression in initializer [-fpermissive]
   67 |                 ll ret = C(n + 1, i), C(s + (n - t), i - 1);
      |                                                           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
const ll INF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS  = 1e-9;

ll mod_pow(ll x, ll n, ll mod) {
	if (n == 0) return 1;
	ll res = mod_pow(x * x % mod, n / 2, mod);
	if (n & 1) res = res * x % mod;
	
	return res;
}

vector<ll> fact, inv;
void fact_inv(int n, ll mod) {
	fact.resize(n + 1);
	inv.resize(n + 1);
	
	fact[0] = 1;
	FOR(i, 1, n + 1) fact[i] = fact[i - 1] * i % mod;
	inv[n] = mod_pow(fact[n], mod - 2, mod);
	for (int i = n; i > 0; i--) inv[i - 1] = inv[i] * i % mod;
}

ll ncr(ll n, ll r, ll mod) {
	if (n < r || r < 0 || n < 0) return 0;
	return fact[n] * inv[r] % mod * inv[n - r] % mod;
}

int n;
int a[112345];
bool done[112345];

int main() {
	cin >> n;
	REP(i, n + 1) scanf("%d", a + i);
	
	int num = -1;
	REP(i, n + 1) {
		if (done[a[i]]) num = a[i];
		done[a[i]] = true;
	}
	
	int l = -1, r = -1;
	REP(i, n + 1) if (a[i] == num) {
		if (l == -1) l = i;
		else r = i;
	}
	
	fact_inv(112345, MOD);
	
	FOR(k, 1, n + 2) {
		ll ans = ncr(n + 1, k, MOD);
		
		ll c = r - l - 1;
		if (n - 1 - c >= k - 1) ans -= ncr(n - 1 - c, k - 1, MOD);.
		
		ans = (ans + MOD) % MOD;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:75: error: expected primary-expression before '.' token
   72 |                 if (n - 1 - c >= k - 1) ans -= ncr(n - 1 - c, k - 1, MOD);.
      |                                                                           ^