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

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;

// Define
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using int128 = __int128;
using cint = cpp_int;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ull MAX = ULONG_MAX;
#define endl '\n'
#define space ' '
#define def inline auto
#define func inline constexpr ll
#define run __attribute__((constructor)) def _
#define all(v) begin(v), end(v)

// Debug
#define debug(...)                                                             \
    {                                                                          \
        cerr << __LINE__ << ": " << #__VA_ARGS__ << " = ";                     \
        for (auto &&X : {__VA_ARGS__}) cerr << "[" << X << "] ";               \
        cerr << endl;                                                          \
    }

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i <= _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i >= _##i; --i)
#define each(i, a) for (auto &&i : a)
#define rep(i, n) inc(i, 0, n - 1)

// Stream
#define input(a) scanf("%lld", &(a))
#define output(a) printf("%lld\n", (a))
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("-O3")
#pragma GCC target("avx")

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

def mod_pow(ll a, ll b) {
    if (b == 0) return 1LL;
    if (b & 1) return (a * mod_pow(a, b - 1)) % MOD;
    ll half = mod_pow(a, b / 2);
    return half * half % MOD;
}

def mod_comb(ll n, ll r) {
    r = min(r, n - r);
    ll sup = 1, sub = 1;
    rep(i, r) {
        sup *= n - i, sub *= i + 1;
        sup %= MOD, sub %= MOD;
    }
    return sup * mod_pow(sub, MOD - 2) % MOD;
}

ll N, A, P[100000], L, R, S;

signed main() {
    cin >> N;
    rep(i, N) P[i] = -1;
    rep(i, N + 1) {
        cin >> A;
        if(P[i] == -1) P[A - 1] = i;
        else {L = P[A - 1], R = i;}
    }
    rep(K, N){
        S = mod_comb(N + 1, K + 1)
        S -= mod_comb(L - 1 + N - R, K)
        cout << S << endl;
    }
}

// for compilation: g++ -O3 -o _ _.cpp -std=c++17

Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "pch.h"

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
using namespace std;

#define INF LLONG_MAX/3
#define inf INT_MAX/3
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> P;
typedef long long ll;

int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {
	return a / gcd(a, b)*b;
}
int modpow(int a, int b) {
	if (b == 0)return 1;
	if (b == 1)return a % MOD;
	if (b % 2)return modpow(a, b - 1)*a%MOD;
	else return modpow(a, b / 2)*modpow(a, b / 2) % MOD;
}
int comb(int a, int b) {
	if (b == 0 || a == b)return 1;
	if (b == 1)return a % MOD;
	return (comb(a - 1, b - 1) + comb(a - 1, b)) % MOD;
}



int main() {
	int n, a[100010], b[100010];
	cin >> n;
	n++;
	rep(i, n) {
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b, b + n);
	int x = -1, y;
	int m;
	for (int i = 1;i < n;i++)if (b[i] == b[i - 1])m = b[i];
	rep(i, n) {
		if (a[i] == m) {
			if (x == -1)x = i;
			else y = i;
		}
	}
	for(int i=1;i<=n;i++) {
		cout << (comb(n, i) - comb(x-1+n-y,i-1)) % MOD << endl;
	}
	return 0;
}

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

32
525
5453
40919
237336
1107568
4272048
13884156
38567100
92561040
193536720
354817320
573166440
818809200
37158313
166803103
166803103
37158313
818809200
573166440
354817320
193536720
92561040
38567100
13884156
4272048
1107568
237336
40920
5456
528
33
1


Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 32
      | ^~
Language: C++


  for(int i=1;i<=n;i++){
    if(i == 1){
      cout << n-1 << endl;
    }else{
      tmp = ncrgyaku(n,i);
      l = left+right >= i-1 ? ncrgyaku(left+right,i-1): 0;
      cout << (tmp - l + 2*MOD) % MOD << endl;
    }
  }
  
  return 0;
}



Compiler output:
a.cc:2:3: error: expected unqualified-id before 'for'
    2 |   for(int i=1;i<=n;i++){
      |   ^~~
a.cc:2:15: error: 'i' does not name a type
    2 |   for(int i=1;i<=n;i++){
      |               ^
a.cc:2:20: error: 'i' does not name a type
    2 |   for(int i=1;i<=n;i++){
      |                    ^
a.cc:12:3: error: expected unqualified-id before 'return'
   12 |   return 0;
      |   ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

[Window Title]
This is an unregistered copy

[Main Instruction]
Hello! Thanks for trying out Sublime Text.

This is an unregistered evaluation version, and although the trial is untimed, a license must be purchased for continued use.

Would you like to purchase a license now?

[Purchase] [取消]

Compiler output:
a.cc:1:1: error: expected unqualified-id before '[' token
    1 | [Window Title]
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MD = 1000000007;
const int MAXN = 1e5 + 10;

ll fact[MAXN + 1];
ll invfact[MAXN + 1];

// binary exp
ll mod_pow(ll x, ll tn){
  if(tn == 0) return 1;
  ll res = mod_pow(x*x %MD, tn/2);
  if(tn &1) res = res*x %MD; // n is odd
  return res;
}

void init(int N){
  fact[0] = 1;
  for(int i=1;i<=N;i++) fact[i] = (fact[i-1]*i) %MD;
  for(int i=1;i<=N;i++){
    invfact[i] = mod_pow(fact[i], MD-2);
  }
}

ll comb(int tn, int r){
  if(r == 0 || tn == r) return 1;
  if(tn < r) return 0;
  return ((fact[tn]*invfact[r] %MD)*invfact[tn-r] + 1e9+7) %MD;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  ll n; cin >> n;
  // first: value, second: id
  vector<pair<ll, ll> > pa;
  for(int id=1;id<=n+1;id++){
    ll val; cin >> val;
    pa.push_back(make_pair(val, id));
  }
  sort(pa.begin(), pa.end());
  ll left, right;
  for(int i=0;i<pa.size()-1;i++){
    if(pa[i].first == pa[i+1].first){
      left = pa[i].second;
      right = pa[i+1].second;
    }
  }
  ll N = n + 1;
  ll M = left - 1 + N - right;
  init(N);
  for(int k=1;k<=n+1;k++){
    /*
    cout << "comb" << N << " " << k << ": " << comb(N, k) << endl;
    cout << "comb" << M << " " << k-1 << ": " << comb(M, k-1) << endl;
    */
    cout << comb(N, k) - comb(M, k-1) << endl;
  }
}

Compiler output:
a.cc: In function 'll comb(int, int)':
a.cc:32:60: error: invalid operands of types 'double' and 'const ll' {aka 'const long long int'} to binary 'operator%'
   32 |   return ((fact[tn]*invfact[r] %MD)*invfact[tn-r] + 1e9+7) %MD;
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~
      |                                                        |    |
      |                                                        |    const ll {aka const long long int}
      |                                                        double
Language: C

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MD = 1000000007;
const int MAXN = 1e5 + 10;

ll fact[MAXN + 1];
ll invfact[MAXN + 1];

// binary exp
ll mod_pow(ll x, ll tn){
  if(tn == 0) return 1;
  ll res = mod_pow(x*x %MD, tn/2);
  if(tn &1) res = res*x %MD; // n is odd
  return res;
}

void init(int N){
  fact[0] = 1;
  for(int i=1;i<=N;i++) fact[i] = (fact[i-1]*i) %MD;
  for(int i=1;i<=N;i++){
    invfact[i] = mod_pow(fact[i], MD-2);
  }
}

ll comb(int tn, int r){
  if(r == 0 || tn == r) return 1;
  if(tn < r) return 0;
  return ((fact[tn]*invfact[r] %MD)*invfact[tn-r]) %MD;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  ll n; cin >> n;
  // first: value, second: id
  vector<pair<ll, ll> > pa;
  for(int id=1;id<=n+1;id++){
    ll val; cin >> val;
    pa.push_back(make_pair(val, id));
  }
  sort(pa.begin(), pa.end());
  ll left, right;
  for(int i=0;i<pa.size()-1;i++){
    if(pa[i].first == pa[i+1].first){
      left = pa[i].second;
      right = pa[i+1].second;
    }
  }
  ll N = n + 1;
  ll M = left - 1 + N - right;
  init(N);
  for(int k=1;k<=n+1;k++){
    /*
    cout << "comb" << N << " " << k << ": " << comb(N, k) << endl;
    cout << "comb" << M << " " << k-1 << ": " << comb(M, k-1) << endl;
    */
    cout << comb(N, k) - comb(M, k-1) << endl;
  }
}

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

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
ll powmod(ll x,ll n){
    if(n == 0)return 1;
    if(n & 1)return x * powmod(x,n-1) % MOD;
    else    return powmod(x*x % MOD, k/2);
}
ll divmod(ll a,ll b){
    return ((a%MOD) * (powmod(b,MOD-2)%MOD)) % MOD;
}
main(){
    int N;
    cin >> N;
    N++;
    vector<int> A(N);

    set<int> st;
    int l,r;
    for(int i = 0;i < N;i++){
        cin >> A[i];
        if(!st.insert(A[i]).second)r = i;
    }
    for(int i = 0;i < N;i++)if(A[i] == A[r]){
        l = i;
        break;
    }

    vector<ll> t1(N),t2(N);
    int m =  N - (r - l + 1);
    //cout << l << " " << r << " " << m<< endl;
    t1[0] = N;
    t2[0] = 1;
    for(int i = 2;i <= N;i++){
        t1[i-1] = divmod((N-i+1) * t1[i-2],i);
    }
    for(int i = 1;i <= m;i++){
        t2[i] = divmod((m-i+1) * t2[i-1],i);
    }
    for(int i = 0;i < N;i++){
        cout << t1[i] - t2[i] << endl;
    }
}


Compiler output:
a.cc: In function 'll powmod(ll, ll)':
a.cc:9:38: error: 'k' was not declared in this scope
    9 |     else    return powmod(x*x % MOD, k/2);
      |                                      ^
a.cc: At global scope:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
ll powmod(ll x,ll n){
    if(n == 0)return 1;
    if(n & 1)return x * powmod(x,n-1) % MOD;
    eles    return powmod(x*x % MOD, k/2);
}
ll divmod(ll a,ll b){
    return ((a%MOD) * (powmod(b,MOD-2)%MOD)) % MOD;
}
main(){
    int N;
    cin >> N;
    N++;
    vector<int> A(N);

    set<int> st;
    int l,r;
    for(int i = 0;i < N;i++){
        cin >> A[i];
        if(!st.insert(A[i]).second)r = i;
    }
    for(int i = 0;i < N;i++)if(A[i] == A[r]){
        l = i;
        break;
    }

    vector<ll> t1(N),t2(N);
    int m =  N - (r - l + 1);
    //cout << l << " " << r << " " << m<< endl;
    t1[0] = N;
    t2[0] = 1;
    for(int i = 2;i <= N;i++){
        t1[i-1] = divmod((N-i+1) * t1[i-2],i);
    }
    for(int i = 1;i <= m;i++){
        t2[i] = divmod((m-i+1) * t2[i-1],i);
    }
    for(int i = 0;i < N;i++){
        cout << t1[i] - t2[i] << endl;
    }
}

Compiler output:
a.cc: In function 'll powmod(ll, ll)':
a.cc:9:5: error: 'eles' was not declared in this scope
    9 |     eles    return powmod(x*x % MOD, k/2);
      |     ^~~~
a.cc: At global scope:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
a.cc: In function 'll powmod(ll, ll)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

/// referenced: https://beta.atcoder.jp/contests/abc066/submissions/2252964
#include <bits/stdc++.h>
using namespace std;

constexpr int64_t MOD = 1000000007;

int64_t Power(int64_t base, int64_t exp) {
  int64_t x = 1;
  while (exp) {
    if (exp % 2) {
      x = x * base % MOD;
    }
    base = base * base % MOD;
    exp /= 2;
  }
  return x;
}

int64_t Inv(int64_t x) {
  return Power(x, MOD - 2);
}

int64_t Factorial[100002],InvFact[100002];

int64_t C(int64_t n,int64_t r){
  return Factorial[n]*InvFact[r]%MOD*InvFact[n-r]%MOD;
}

int main(){
  int64_t n,a;
  bool c[100002];
  cin >> n;
  for(int64_t i=1;i<=n;i++) c[i]=false;
  int64_t p[100002];
  int64_t x,y;

  for(int64_t i=0;i<=n;i++){
    cin >> a;
    if(c[a]){
      x=p[a];
      y=i;
    }
    c[a]=true;
    p[a]=i;
  }


  Factorial[0]=1;
  for(int64_t i=1;i<=n+1;i++) Factorial[i]=i*Factorial[i-1]%MOD;
  for(int64_t i=0;i<=n+1;i++) InvFact[i]=inv(Factorial[i]);

  for(int64_t i=1;i<=n+1;i++){
    int64_t ans;
    ans=C(n+1,i);
    if(i-1<=n-(y-x)) ans+=MOD-C(n-(y-x),i-1);
    cout << (ans%MOD) << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:42: error: 'inv' was not declared in this scope; did you mean 'Inv'?
   50 |   for(int64_t i=0;i<=n+1;i++) InvFact[i]=inv(Factorial[i]);
      |                                          ^~~
      |                                          Inv
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <set>
 
using ll = long long;
using namespace std;
typedef unsigned long long ull;
typedef pair<ll, ll>P;
 
const ll MOD = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
string abc = "abcdefghijklmnopqrstuvwxyz";
struct edge { ll to, cost; };
struct etree { ll from, to, cost; };
struct people { ll v, k, year; };
struct Combination{
  int mod;
  vector< int64_t > mfact, rfact;

  Combination(int sz, int mod) : mfact(sz + 1), rfact(sz + 1), mod(mod){
    mfact[0] = 1;
    for(int i = 1; i < mfact.size(); i++) {
      mfact[i] = mfact[i - 1] * i % mod;
    }
    rfact[sz] = inv(mfact[sz]);
    for(int i = sz - 1; i >= 0; i--) {
      rfact[i] = rfact[i + 1] * (i + 1) % mod;
    }
  }

  int64_t fact(int k) const{
    return (mfact[k]);
  }

  int64_t pow(int64_t x, int64_t n) const{
    int64_t ret = 1;
    while(n > 0) {
      if(n & 1) (ret *= x) %= mod;
      (x *= x) %= mod;
      n >>= 1;
    }
    return (ret);
  }
 
  int64_t inv(int64_t x) consym6jh,mjt{
    return (pow(x, mod - 2));
  }

  int64_t P(int n, int r) const{
    if(r < 0 || n < r) return (0);
    return (mfact[n] * rfact[n - r] % mod);
  }

  int64_t C(int p, int q) const{
    if(q < 0 || p < q) return (0);
    return (mfact[p] * rfact[q] % mod * rfact[p - q] % mod);
  }

  int64_t H(int n, int r) const{
    if(n < 0 || r < 0) return (0);
    return (r == 0 ? 1 : C(n + r - 1, r));
  }
};
 
int main() {
	ll n, a[100100], cou[100100], itl, itr;
        Combination comb(100100,MOD);
	cin >> n;
	for (int i = 1;i <= n + 1;i++) {
		cin >> a[i];
		if (cou[a[i]] == 0)cou[a[i]]++;
		else itr = i;
	}
	for (int i = 1;i <= n+1;i++) {
		if (a[i] == a[itr]) {
			itl = i;
			break;
		}
	}
	inverse(n + 2);
	for (int i = 1;i <= n + 1;i++) {
		cout << (MOD + comb.C(n + 1, i) - comb.C(itl + n - itr, i - 1)) % MOD << endl;
	}
}

Compiler output:
a.cc:60:24: error: expected ';' at end of member declaration
   60 |   int64_t inv(int64_t x) consym6jh,mjt{
      |                        ^
      |                         ;
a.cc:60:26: error: 'consym6jh' does not name a type
   60 |   int64_t inv(int64_t x) consym6jh,mjt{
      |                          ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:95:9: error: 'inverse' was not declared in this scope
   95 |         inverse(n + 2);
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <string>

using namespace std;

typedef pair<int, int> P;
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define _1 first
#define _2 second
#define pb push_back
#define mod 1000000007
#define INF 105000000000

const int maxn = 1e5 + 10;



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n; cin >> n;
	int a;
	int check[maxn];
	int idx1, idx2;
	memset(check, -1, sizeof check);
	rep(i, n + 1)
	{
		cin >> a;
		if (check[a] != -1)
		{
			idx1 = check[a];
			idx2 = i;
			break;
		}
		else {
			check[a] = i;
		}

	}
	int l = idx1, r = n - idx2;
	ll zentai=1;
	ll tyouhuku=1;

	FOR(k, 1, n + 2)
	{
		zentai = zentai*(n + 2 - k) / k;
		//Print(zentai);
		if (k == 1) tyouhuku = 1;
		else if (k - 1 > l + r)tyouhuku = 0;
		else tyouhuku = tyouhuku*(l + r + 1 - (k - 1)) / (k - 1);

		if (k == 1)
		{
			Print(n); 
			continue;
		}
		//Print(tyouhuku);
		Print((zentai - tyouhuku) % mod);
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: 'memset' was not declared in this scope
   61 |         memset(check, -1, sizeof check);
      |         ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include <functional>
  +++ |+#include <cstring>
   15 | #include <string>
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>

using namespace std;

typedef pair<int, int> P;
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define _1 first
#define _2 second
#define pb push_back
#define mod 1000000007
#define INF 105000000000

const int maxn = 1e5 + 10;



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n; cin >> n;
	int a;
	int check[maxn];
	int idx1, idx2;
	memset(check, -1, sizeof check);
	rep(i, n + 1)
	{
		cin >> a;
		if (check[a] != -1)
		{
			idx1 = check[a];
			idx2 = i;
			break;
		}
		else {
			check[a] = i;
		}

	}
	int l = idx1, r = n - idx2;
	ll zentai=1;
	ll tyouhuku=1;

	FOR(k, 1, n + 2)
	{
		zentai = zentai*(n + 2 - k) / k;
		//Print(zentai);
		if (k == 1) tyouhuku = 1;
		else if (k - 1 > l + r)tyouhuku = 0;
		else tyouhuku = tyouhuku*(l + r + 1 - (k - 1)) / (k - 1);

		if (k == 1)
		{
			Print(n); 
			continue;
		}
		//Print(tyouhuku);
		Print((zentai - tyouhuku) % mod);
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'memset' was not declared in this scope
   60 |         memset(check, -1, sizeof check);
      |         ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include <functional>
  +++ |+#include <cstring>
   15 |
Language: C++

ll fact[100002], factInv[100002];
//フェルマーの小定理
ll power(ll x) {
    ll res = 1, n = MOD - 2;
    while(n > 0) {
        if (n & 1) res = (res * x) % MOD;
        x = (x * x) % MOD;
        n >>= 1;
    }
    return res;
}

void factrial() {
    fact[0] = factInv[0] = 1;
    repl(i, 1, 100002) {
        fact[i] = (fact[i - 1] * i) % MOD;
        factInv[i] = power(fact[i]);
    }
}

int main(){
    cin.sync_with_stdio(false);
    ll n;
    cin >> n;
    int a, b[n] = {};
    rep(i, n) b[i] = -1;
    int l, r;
    rep(i, n + 1) {
        cin >> a;
        if (b[a - 1] != -1) l = b[a - 1], r = i;
        else b[a - 1] = i;
    }
    factrial();
    int p = n + 1 - (r - l + 1);
    repl(i, 1, n + 2) {
        ll g = (((fact[n + 1] * factInv[i]) % MOD) * factInv[n + 1 - i]) % MOD;
        ll h = (p < i - 1) ? 0 : (((fact[p] * factInv[i - 1]) % MOD) * factInv[p - i + 1]) % MOD;
        cout << (g - h + MOD) % MOD << endl;
    }
    return 0;
}


Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll fact[100002], factInv[100002];
      | ^~
a.cc:3:1: error: 'll' does not name a type
    3 | ll power(ll x) {
      | ^~
a.cc: In function 'void factrial()':
a.cc:14:5: error: 'fact' was not declared in this scope
   14 |     fact[0] = factInv[0] = 1;
      |     ^~~~
a.cc:14:15: error: 'factInv' was not declared in this scope
   14 |     fact[0] = factInv[0] = 1;
      |               ^~~~~~~
a.cc:15:10: error: 'i' was not declared in this scope
   15 |     repl(i, 1, 100002) {
      |          ^
a.cc:15:5: error: 'repl' was not declared in this scope
   15 |     repl(i, 1, 100002) {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:22:5: error: 'cin' was not declared in this scope
   22 |     cin.sync_with_stdio(false);
      |     ^~~
a.cc:23:5: error: 'll' was not declared in this scope
   23 |     ll n;
      |     ^~
a.cc:24:12: error: 'n' was not declared in this scope
   24 |     cin >> n;
      |            ^
a.cc:26:9: error: 'i' was not declared in this scope
   26 |     rep(i, n) b[i] = -1;
      |         ^
a.cc:26:5: error: 'rep' was not declared in this scope
   26 |     rep(i, n) b[i] = -1;
      |     ^~~
a.cc:35:5: error: 'repl' was not declared in this scope
   35 |     repl(i, 1, n + 2) {
      |     ^~~~
Language: C++

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

int NN[100002];

long long int dp[2][100002];
long long int dpse[2][100002];

const int MOD = 1000000007;

long long int kaizyo(long long int n) {  // n!
	if (n == 1 || n == 0) return (long long int)1;
	else return (long long int)((n * kaizyo(n - 1)) % MOD);
}

long long int ruizyo(long long int n, long long int m) {  // n^m
	if (m == 1) return (long long int)n % MOD;
	else if (m % 2 == 0) {
		return (long long int)(ruizyo(((n * n) % MOD), m / 2) % MOD);
	}
	else {
		return (long long int)((n * ruizyo(n, m - 1)) % MOD);
	}
}


int combination(int n, int m) {
	/*for (int i = 0; i <= n; i++) {  // iC?
	for (int j = 0; j <= i; j++) {  // iCj
	dp[1][j] = dp[0][j - 1] + dp[0][j];
	}
	swap(dp[0], dp[1]);
	}
	return dp[0][m];*/
	if (n < m || m < 0) return 0;
	return (((kaizyo(n) * ruizyo(kaizyo(m), MOD - 2)) % MOD) * ruizyo(kaizyo(n - m), MOD - 2)) % MOD;
}

/*long combination(int m, int n) {
	long long int c = 1;
	m = (n - m < m ? n - m : m);
	for (int ns = n - m + 1, ms = 1; ms <= m; ns++, ms++) {
		c *= ns;
		c /= ms;
	}
	return c;
}*/

int main()
{
	int n = 0;
	cin >> n;
	vector<int> a(n+2);
	a[0] = -1;
	for (int i = 1; i <= n+1; i++) {
		cin >> a[i];
	}

	memset(NN, 0, sizeof(NN));
	memset(dp, 0, sizeof(dp));
	memset(dpse, 0, sizeof(dpse));

	int snum = 0;
	int endnum = 0;

	for (int i = 1; i <= n + 1; i++) {
		if (NN[a[i]] == 0) NN[a[i]] = i;
		else {
			snum = NN[a[i]];
			endnum = i;
			break;
		}
	}

	int l = snum - 1 + (n + 1 - endnum);
	

	/*for (int i = 1; i <= l; i++) {  //全長i,lまで
		dpse[1][1] = i;
		for (int j = 2; j <= n + 1; j++) {
			dpse[1][j] = dpse[0][j - 1] + dpse[0][j];
		}
		swap(dpse[1], dpse[0]);
	}*/


	/*for (int i = 1; i <= n + 1; i++) {  //全長i,n+1まで
		dp[1][1] = i;
		for (int j = 2; j <= n + 1; j++) {
			dp[1][j] = dp[0][j - 1] + dp[0][j];
		}
		if (i == l) {
			for (int j = 0; j <= n + 1; j++) {
				dpse[0][j] = dp[1][j];
			}
		}
		swap(dp[1], dp[0]);
	}

	cout << n << endl;  // k=1

	long long int ans = 0;


	for (int i = 2; i <= n + 1; i++) {
		ans = dp[0][i];
		ans -= dpse[0][i - 1];
		cout << ans % 1000000007 << endl; // i行目
		//cout << i << "," << dpse[0][i - 1] << endl;
	}*/

	cout << n << endl;

	for (int i = 2; i <= n+1; i++) {
		cout << combination(n + 1, i) - combination(l, i - 1) << endl;
	}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'memset' was not declared in this scope
   60 |         memset(NN, 0, sizeof(NN));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

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

int NN[100002];

long long int dp[2][100002];
long long int dplong[2][100002];
long long int dpse[2][100002];
long long int dpselong[2][100002];

int main()
{
	int n = 0;
	cin >> n;
	vector<int> a(n+2);
	a[0] = -1;
	for (int i = 1; i <= n+1; i++) {
		cin >> a[i];
	}

	memset(NN, 0, sizeof(NN));
	memset(dp, 0, sizeof(dp));
	memset(dplong, 0, sizeof(dplong));
	memset(dpse, 0, sizeof(dpse));

	int snum = 0;
	int endnum = 0;

	for (int i = 1; i <= n + 1; i++) {
		if (NN[a[i]] == 0) NN[a[i]] = i;
		else {
			snum = NN[a[i]];
			endnum = i;
			break;
		}
	}

	int l = snum - 1 + (n + 1 - endnum);
	

	for (int i = 1; i <= l; i++) {  //全長i,lまで
		dpse[1][1] = i;
		for (int j = 2; j <= n + 1; j++) {
			dpse[1][j] = dpse[0][j - 1] + dpse[0][j];
		}
		swap(dpse[1], dpse[0]);
	}


	for (int i = 1; i <= n + 1; i++) {  //全長i,n+1まで
		dp[1][1] = i;
		for (int j = 2; j <= n + 1; j++) {
			dp[1][j] = dp[0][j - 1] + dp[0][j];
		}
		swap(dp[1], dp[0]);
	}

	cout << n << endl;  // k=1

	long long int ans = 0;


	for (int i = 2; i <= n + 1; i++) {
		ans = dp[0][i];
		ans -= dpse[0][i - 1];
		cout << ans % 1000000007 << endl; // i行目
		//cout << i << "," << dpse[0][i - 1] << endl;
	}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'memset' was not declared in this scope
   22 |         memset(NN, 0, sizeof(NN));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
    return b?gcd(b,a%b):a;
}
const int N=200005;
const int maxn = 1e5 + 10, MOD = 1e9 + 7;
ll pos[maxn],fac[maxn],facm[maxn];
ll quick_pow(ll a,ll n,ll p)
{
    ll x = a;
    ll res = 1;
    while(n){
        if(n & 1){
            res = ((ll)res * (ll)x) % p;
        }
        n >>= 1;
        x = ((ll)x*(ll)x) % p;
    }
    return res;
}
ll C(ll n,ll k){
    if(k > n) return 0ll;
    ll ans = fac[k]*fac[n-k]%MOD;
    ans = (fac[n]*quick_pow(ans,MOD-2ll,MOD))%MOD;
    return ans;
}
int main()
{
    fac[0] = 1;
    for(int i = 1;i < maxn;i++)
        fac[i] = (fac[i-1]*i)%MOD;
    ll n;
    scanf("%lld", &n);
    n++;
    ll m, x;
    for(int i = 1;i <= n;i++){
        scanf("%lld", &x);
        if (pos[x]){
            m = n - (i - pos[x] + 1);
            break;
        }
        pos[x] = i;
    }
    for(int i = 1;i <= n;i++)
        printf("%lld\n", (C(n, i) - C(m, i-1)+MOD) % MOD);
    return 0;
}


Compiler output:
a.cc:19:13: error: expected unqualified-id before numeric constant
   19 | #define MOD 1000000007
      |             ^~~~~~~~~~
a.cc:30:28: note: in expansion of macro 'MOD'
   30 | const int maxn = 1e5 + 10, MOD = 1e9 + 7;
      |                            ^~~
Language: C


#include <stdio.h>



int fact(int a){
  int x = 1,y;
     if(a ==0){ return(x);} else {
         for (int y =1; y <= a; y++){
           x = x*y;
         }
     }
         return(x);
}
 


int combi(int n,int r){
      int ncr;
      if(r <= 0){ return 1;} else{
        ncr = fact(n)/(fact(r)*fact(n-r))
        return(ncr);
        
      }
}
    

int main(void) {
   int inputsiz,i,fmark,bmark;
   fmark,bmark = 0;
   scanf("%d", &inputsiz);
   inputsiz++;
   int input[inputsiz],check[inputsiz];
   for(i=0; i < inputsiz; i++) {
      check[i]=0;
   }
   for(i=0; i < inputsiz; i++) {
      scanf("%d",&input[i]);
      if (bmark == 0) {
        if (check[input[i]] == 0 /*if check is empty*/) {
           check[input[i]] = i+1; 
        } else {  /*mark the i pointer and the check cell */ 
             fmark = check[input[i]]-1;
             bmark = i;
          }
      }
   }
   int result;
   for (int k = 1; k < inputsiz+1; k++){
        result = ( combi(inputsiz,k) - combi(fmark+inputsiz-1-bmark,k-1) )%1000000007;
        if (result = 0){result = 1;}
        printf("%d\n",result);
   } 
   
   
}




Compiler output:
main.c: In function 'combi':
main.c:21:42: error: expected ';' before 'return'
   21 |         ncr = fact(n)/(fact(r)*fact(n-r))
      |                                          ^
      |                                          ;
   22 |         return(ncr);
      |         ~~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
using namespace std;
#define ll long long 
const int Mod = 1e9 + 7, MaxN = 100005;
int n, a[MaxN], vis[MaxN];
ll fact[MaxN], rfact[MaxN];
ll quickPow(ll a, int b)
{
    ll res=1;
    for (;b;b>>=1,a=a*a%Mod)
        if (b&1)
            res=res*a%Mod;
    return res;
}
ll C(int n, int m)
{
    if (n<0||m<0)
        return 0;
    if (n<m)
        return 0;
    return fact[n]*rfact[m]%Mod*rfact[n-m]%Mod;
}
int main()
{
    cin>>n;
    fact[0]=rfact[0]=ll(1);
    for (int i=1;i<MaxN;i++)
        fact[i] = fact[i-1]*i%Mod;
    for (int i=1;i<MaxN;i++)
        rfact[i]=quickPow(fact[i],Mod-2);
    int p[2];
    for (int i = 1; i <= n + 1; i++)
    {
        scanf("%d",a+i);
        if (vis[a[i]])
            p[0]=vis[a[i]],p[1]=i;
        vis[a[i]]=i;
    }
    int tot=p[0]+n-p[1];
    for (int i=1;i<=n+1;i++)
    {
        long long ans=C(n+1,i),cur=C(tot,i-1);
        ans=((ans-cur) % Mod + Mod)%Mod;
        printf("%lld\n", ans);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: expected primary-expression before 'long'
   25 | #define ll long long
      |            ^~~~
a.cc:48:22: note: in expansion of macro 'll'
   48 |     fact[0]=rfact[0]=ll(1);
      |                      ^~
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#define MOD 1000000007
using namespace std;
typedef long long int ll;

ll *FACT, *IFACT;
ll extgcd(ll a, ll b, ll &x, ll &y) {
	ll g = a; x = 1; y = 0;
	if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
	return g;
}
ll invMod(ll a, ll m) {
	ll x, y;
	if (extgcd(a, m, x, y) == 1) return (x + m) % m;
	else                         return 0; // unsolvable
}

void init(ll N){
	FACT = new ll[N + 1];
	IFACT = new ll[N + 1];
	FACT[0] = 1;
	IFACT[0] = 1;
	for (ll i = 1; i <= N; i++){
		FACT[i] = FACT[i - 1] * i % MOD;
		IFACT[i] = invMod(FACT[i], MOD);
	}
}
long C(ll n, ll r)
{
	if (n < 0 || r < 0 || r > n)return 0;
	if (r > n / 2)r = n - r;
	return FACT[n] * IFACT[n - r] % MOD*IFACT[r] % MOD;
}

ll main()
{
	ll ans;
	ll i;
	ll j;
	ll n;
	ll dup;
	ll dup_f = -1;
	ll dup_b;
	cin >> n;
	ll a[100005];
	ll b[100005];
	init(100010);
	for (i = 0; i<n + 1; i++){
		cin >> a[i];
	};
	memcpy(b, a, 100005);
	sort(begin(a), begin(a) + n);
	for (i = 0; i<n + 1; i++){
		if (a[i] == a[i + 1]){
			dup = a[i];
		};
	};
	for (i = 0; i<n + 1; i++){
		if (b[i] == dup && dup_f == -1){
			dup_f = i;
		}
		else if (b[i] == dup){
			dup_b = i;
		};
	};
	for (i = 0; i<n + 1; i++){
		ans = C(n + 1, i + 1) - C(dup_f + n - dup_b, i);
		if (ans <= -1){
			ans = ans + MOD;
		}
		cout << ans << endl;
	};




	return 0;
}

Compiler output:
a.cc:37:1: error: '::main' must return 'int'
   37 | ll main()
      | ^~
Language: C++

def comb(n,k):
  if k == 0:
    return 1
  if n < k:
    return 0

  ret = 1
  for i in xrange(k):
    ret *= n-i
  for i in xrange(1,k+1):
    ret /= i
  return ret % 1000000007

n = int(raw_input())
a = map(int,raw_input().split())

b = sorted(a)
t = -1
for i in xrange(len(b)-1):
  if b[i] == b[i+1]:
    t = b[i]

L = 0
M = 0
R = 0
c = 0
for i in xrange(len(a)):
  if a[i] == t:
    c += 1
  elif c == 0:
    L += 1
  elif c == 1:
    M += 1
  elif c == 2:
    R += 1

lc = {}
rc = {}
for i in xrange(0,L+1):
  lc[i] = comb(L,i)
for i in xrange(0,R+1):
  rc[i] = comb(R,i)



for k in xrange(1,n+2):
  total = 0
  for i in xrange(k):
    K = k-1
    if i not in lc:
      lc[i] = 0
    if K-i not in rc:
      rc[K-i] = 0
    # print i,K-i," ",lc[i],rc[K-i],lc[i] * rc[K-i]
    total += lc[i] * rc[K-i]
    total %= 1000000007
  print comb(n+1,k) - total





Compiler output:
a.cc:54:7: error: invalid preprocessing directive #print
   54 |     # print i,K-i," ",lc[i],rc[K-i],lc[i] * rc[K-i]
      |       ^~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def comb(n,k):
      | ^~~
a.cc:38:1: error: 'rc' does not name a type
   38 | rc = {}
      | ^~
a.cc:39:1: error: expected unqualified-id before 'for'
   39 | for i in xrange(0,L+1):
      | ^~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Main {
	private static final long MOD = 1_000_000_000 + 7;

	// 反復二乗法を用いる
	public static long myPow(long a) {
		long ans = 1L;
		long x = a;
		long b = 1_000_000_000 + 5L;

		for(int i = 0; i < 64; i++) {
			if((b & (1L << i)) != 0L) {
				ans = (ans * x) % MOD;
			}
			x = (x * x) % MOD;
		}

		return ans;
	}

	public static long nck(int n, int k, long[] fact, long[] inverse) {
		if(n < k || n < 0 || k < 0) {
			return 0;
		}
		return (((fact[n] * myPow(fact[n - k])) % MOD) * myPow(fact[k])) % MOD;
	}

	public static void main(String[] args) {
		new Main().run();

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] a = new int[n + 1];
		int[] count = new int[n + 1];

		int tar = 0;
		int l = 0; int r = 0;

		for(int i = 0; i < n + 1; i++) {
			a[i] = sc.nextInt();
			count[a[i]]++;
			if(count[a[i]] == 2) {
				tar = a[i];
				r = i + 1;
			}
		}

		for(int i = 0; i < n + 1; i++) {
			if(a[i] == tar) {
				l = i + 1;
				break;
			}
		}

		// n+1までの階乗の計算
		long[] fact = new long[n + 2];
		fact[0] = 1L;
		for(int i = 1; i <= n + 1; i++) {
			fact[i] = (fact[i - 1] * i) % MOD;
		}

		for(int k = 1; k <= n + 1; k++) {
			long comb1 = nck(n + 1, k, fact);
			long comb2 = nck(l + n - r, k - 1, fact);
			System.out.println((comb1 - comb2 + MOD) % MOD);
		}
	}
}



Compiler output:
Main.java:31: error: cannot find symbol
		new Main().run();
		          ^
  symbol:   method run()
  location: class Main
Main.java:66: error: method nck in class Main cannot be applied to given types;
			long comb1 = nck(n + 1, k, fact);
			             ^
  required: int,int,long[],long[]
  found:    int,int,long[]
  reason: actual and formal argument lists differ in length
Main.java:67: error: method nck in class Main cannot be applied to given types;
			long comb2 = nck(l + n - r, k - 1, fact);
			             ^
  required: int,int,long[],long[]
  found:    int,int,long[]
  reason: actual and formal argument lists differ in length
3 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Main {
	private static final long MOD = 1_000_000_000 + 7;

	// 反復二乗法を用いる
	public static long myPow(long a) {
		long ans = 1L;
		long x = a;
		long b = (1_000_000_000 + 5)L;

		for(int i = 0; i < 32; i++) {
			if((b & (1L << i)) != 0L) {
				ans = (ans * x) % MOD;
			}
			x = (x * x) % MOD;
		}

		return ans % MOD;
	}

	public static long nck(int n, int k, long[] fact) {
		if(n < k) {
			return 0;
		}
		return (((fact[n] * myPow(fact[n - k])) % MOD) * myPow(fact[k])) % MOD;
	}

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

		int n = sc.nextInt();
		int[] a = new int[n + 1];
		int[] count = new int[n + 1];

		int tar = 0;
		int l = -1; int r = -1;

		for(int i = 0; i < n + 1; i++) {
			a[i] = sc.nextInt();
			count[a[i]]++;
			if(count[a[i]] == 2) {
				tar = a[i];
				r = i + 1;
			}
		}

		for(int i = 0; i < n + 1; i++) {
			if(a[i] == tar) {
				l = i + 1;
				break;
			}
		}

		// n+1までの階乗の計算
		long[] fact = new long[n + 2];
		fact[0] = 1;
		for(int i = 1; i <= n + 1; i++) {
			fact[i] = (fact[i - 1] * i) % MOD;
		}

		for(int k = 1; k <= n + 1; k++) {
			//	long comb1 = (fact[n + 1] * ((myPow(fact[n + 1 - k]) * myPow(fact[k])) % MOD)) % MOD;
			long comb1 = nck(n + 1, k, fact);
			//	long comb2 = 0;
			//	if(l + n - r >= k - 1) {
			//		comb2 = (fact[l + n - r] * ((myPow(fact[l + n - r - k + 1]) * myPow(fact[k - 1])) % MOD)) % MOD;
			//	}
			long comb2 = nck(l + n - r, k - 1, fact);
			System.out.println((comb1 - comb2) % MOD);
		}
	}
}


Compiler output:
Main.java:11: error: ';' expected
		long b = (1_000_000_000 + 5)L;
		                            ^
1 error
Language: C++

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>

#define REP(i,x,y) for(int i=(int)(x);i<(int)(y);i++)
#define RREP(i,x,y) for(int i=(int)(x);i>=(int)(y);i--)
#define all(x) (x).begin(),(x).end()

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

typedef long long ll;
typedef int long long;

using namespace std;

const int MAX_N = 100001;
const ll MOD = 1000000000 + 7;

int n;
int a[MAX_N];
int _a[MAX_N];
ll F[MAX_N];

// k!
void factorial(){
    F[0] = 1;
    F[1] = 1;
    REP(i, 2, n+2){
        F[i] = F[i-1] * i % MOD;
        eprintf("F[%d]=%d\n",i,F[i]);
    }
}

int extgcd(int a, int b, int &x, int &y) {
    for (int u = y = 1, v = x = 0; a;) {
        int q = b / a;
        swap(x -= q * u, u);
        swap(y -= q * v, v);
        b -= q*a; swap(b, a);
    }
    return b;
}

int invmod(int a, int m) {
    int x, y;
    if (extgcd(a, m, x, y) == 1) return (x + m) % m;
    else return 0; // unsolvable
}

int combination(int _n ,int _r){
    if(F[0] != 1) factorial();

    // nCr = n!/(n-r)!r!
    ll combination = 1;

    combination = F[_n];
    combination *= invmod(F[_n - _r], MOD);
    combination %= MOD;
    combination *= invmod(F[_r], MOD);
    combination %= MOD;

    return combination;
}

string solve() {
    string ans = "";
    ll cmb = 1;
    int both_sides_num = 0;
    int two_num = -1;
    int left_pos = -1;
    int right_pos = -1;
    sort(begin(_a), begin(_a) + n + 1);
    REP(i,0,n){
        if(_a[i] == _a[i+1]){
            two_num = _a[i];
            break;
        }
    }
    REP(i,0,n+1){
        if(left_pos == -1){
            if(a[i] == two_num) left_pos = i;
        }else{
            if(a[i] == two_num){
                right_pos = i;
                break;
            }
        }
    }
    // n+1Ck - both_sides_numC(k-1)
    both_sides_num = left_pos - right_pos + n;
    eprintf("leftpos:%d, rightpos:%d\n",left_pos, right_pos);
    eprintf("both_sides_num: %d\n", both_sides_num);
    REP(k, 1, n+2){
        if(both_sides_num >= k - 1){
            cmb = combination(n+1, k) - combination(both_sides_num, k-1);
        }else{
            cmb = combination(n+1, k);
        }
//        if(k != n+1) {
            ans += to_string(cmb) + "\n";
//        }else{
//            ans += to_string(cmb);
//        }
    }
    return ans;
}

int main() {
    // to shorten execution time for iostream
    cin.tie(0);
    ios::sync_with_stdio(false);

    F[0] = -1;

    cin >> n;
    REP(i, 0, n+1){
        cin >> a[i];
        _a[i] = a[i];
    }
    cout << solve() << "\n";
    return 0;
}


Compiler output:
a.cc:26:18: error: declaration does not declare anything [-fpermissive]
   26 | typedef int long long;
      |                  ^~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
#define p 1000000007

int N,d1,d2;

//cmb(n,k)の実装nCk%p
int fact(int x){
    if(x==0) return 1;
    if(x>0) return x*fact(x-1);
};
 
int cmb(int x,int r){
    if(x<r) return 0;
    if(x==r) return 1;
    if(r==0 && x!=0) return 1;
    if(r>x/2) r=x-r;
    return (x*fact(x-1))/fact(x-1)*fact(x-r);
};

//cmbを使ってans
long long ans(int k){
    long long rt=cmb(N+1,k);
        if(d1+1>=k)rt-=cmb(d1,k-1);
        if(n-d2+1>=k)rt-=cmb(N-d2,k-1);
    
    return rt%=p;
};


int main(void){//d1は重複してるやつがd項目ってこと(a[d1]==a[d2])
    scanf("%d",&N);
    int a[N+1],b[N+1];
    fill(b, b+N+1, 0);

    for(int i=0;i<N+1;i++){
        cin>>a[i];
        b[a[i]]++;
        if(b[a[i]]==2){
            d2=i;
            break;
        }
    }

    for(int i=0;i<N+1;i++){
        if(a[i]==a[d2]){
            d1=i;
            break;
        }
    }

    printf("%d\n",N);
    for(int k=2;k<N+2;k++)
        printf("%lld\n",ans(k));
    
    return 0;
}

Compiler output:
a.cc: In function 'long long int ans(int)':
a.cc:26:12: error: 'n' was not declared in this scope
   26 |         if(n-d2+1>=k)rt-=cmb(N-d2,k-1);
      |            ^
a.cc: In function 'int fact(int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | };
      | ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
#define p 1000000007

int N,d1,d2;

//cmb(n,k)の実装nCk%p
int fact(int n){
    if(x==0) {return 1;}
    if(x>0) {return n*fact(n-1);}
};
 
int cmb(int x,int r){
    if(x==r) return 1;
    if (r==0 && x!=0) return 1;
    else return (x*fact(x-1))/fact(x-1)*fact(x-r);
};

//cmbを使ってans
long long ans(int k){
    long long rt=cmb(N+1,k);
        rt-=cmb(d1,k-1);
        rt-=cmb(N-d2,k-1);
    
    return rt%=p;
};


int main(void){//d1は重複してるやつがd項目ってこと(a[d1]==a[d2])
    scanf("%d",&N);
    int a[N+1],b[N+1];
    fill(b, b+N+1, 0);

    for(int i=0;i<N+1;i++){
        cin>>a[i];
        b[a[i]]++;
        if(b[a[i]]==2){
            d2=i;
            break;
        }
    }

    for(int i=0;i<N+1;i++){
        if(a[i]==a[d2]){
            d1=i;
            break;
        }
    }

    printf("%d\n",N);
    for(int k=2;k<N+2;k++)
        printf("%lld\n",ans(k));
    
    return 0;
}

Compiler output:
a.cc: In function 'int fact(int)':
a.cc:10:8: error: 'x' was not declared in this scope
   10 |     if(x==0) {return 1;}
      |        ^
a.cc:11:8: error: 'x' was not declared in this scope
   11 |     if(x>0) {return n*fact(n-1);}
      |        ^
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | };
      | ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
#define p 1000000007

int N,d1,d2;

//cmb(n,k)の実装nCk%p
int fact(int x){
    if(x==0) {return 1;}
    if(x>0) {return x*fact(n-1);}
};
 
int cmb(int x,int r){
    if(x==r) return 1;
    if (r==0 && x!=0) return 1;
    else return (x*fact(x-1))/fact(x-1)*fact(x-r);
};

//cmbを使ってans
long long ans(int k){
    long long rt=cmb(N+1,k);
        rt-=cmb(d1,k-1);
        rt-=cmb(N-d2,k-1);
    
    return rt%=p;
};


int main(void){//d1は重複してるやつがd項目ってこと(a[d1]==a[d2])
    scanf("%d",&N);
    int a[N+1],b[N+1];
    fill(b, b+N+1, 0);

    for(int i=0;i<N+1;i++){
        cin>>a[i];
        b[a[i]]++;
        if(b[a[i]]==2){
            d2=i;
            break;
        }
    }

    for(int i=0;i<N+1;i++){
        if(a[i]==a[d2]){
            d1=i;
            break;
        }
    }

    printf("%d\n",N);
    for(int k=2;k<N+2;k++)
        printf("%lld\n",ans(k));
    
    return 0;
}

Compiler output:
a.cc: In function 'int fact(int)':
a.cc:11:28: error: 'n' was not declared in this scope
   11 |     if(x>0) {return x*fact(n-1);}
      |                            ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
#define p 1000000007

int N,d1,d2;

//cmb(n,k)の実装nCk%p
int fact(int x){
    if(x==0) return 1;
    if (x>0) return x*fact(n-1);
};
 
int cmb(int x,int r){
    if(x==r) return 1;
    if (r==0 && x!=0) return 1;
    else return (x*fact(x-1))/fact(x-1)*fact(x-r);
};

//cmbを使ってans
long long ans(int k){
    long long rt=cmb(N+1,k);
        rt-=cmb(d1,k-1);
        rt-=cmb(N-d2,k-1);
    
    return rt%=p;
};


int main(void){//d1は重複してるやつがd項目ってこと(a[d1]==a[d2])
    scanf("%d",&N);
    int a[N+1],b[N+1];
    fill(b, b+N+1, 0);

    for(int i=0;i<N+1;i++){
        cin>>a[i];
        b[a[i]]++;
        if(b[a[i]]==2){
            d2=i;
            break;
        }
    }

    for(int i=0;i<N+1;i++){
        if(a[i]==a[d2]){
            d1=i;
            break;
        }
    }

    printf("%d\n",N);
    for(int k=2;k<N+2;k++)
        printf("%d\n",ans(k));
    
    return 0;
}

Compiler output:
a.cc: In function 'int fact(int)':
a.cc:11:28: error: 'n' was not declared in this scope
   11 |     if (x>0) return x*fact(n-1);
      |                            ^
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NUM 100010
#define TEISUU 1000000007

unsigned long long expo(unsigned long long x, unsigned long long n) {
  unsigned long long res = 1;

  while (n) {
    if (n & 1ULL) {
      res = (res * x) % TEISUU;
    }
    x = (x * x) % TEISUU;
    n >>= 1ULL;
  }

  return (res % TEISUU);
}

unsigned long long calc_combi(int n, int r) {
  int i;
  unsigned long long int bunshi = 1;
  unsigned long long int bunbo = 1;

  if (r > n) {
    return 0;
  }

  if (n - r > r) {
    r = n - r;
  }
  if (r == 0) {
    return 1;
  } else {
    for (i = 1; i <= r; i++) {
      bunbo = bunbo * i;
      bunshi = (bunshi * (n - r + i));
      if (bunbo >> 10) {
        bunbo = bunbo % TEISUU;
      }
      if (bunshi >> 10) {
        bunshi = bunshi % TEISUU;
      }
    }
    bunbo = expo(bunbo, TEISUU - 2);
    return (bunbo * bunshi) % TEISUU;
  }
}

int main() {
  int i, j;
  int *x = (int *)malloc(sizeof(int) * NUM);
  int n;
  int temp;
  int between;
  unsigned long long int answer;
  unsigned long long int combinarion[NUM];

  for (i = 0; i < NUM; i++) {
    x[i] = -1;
  }

  scanf("%d", &n);
  for (i = 1; i <= n + 1; i++) {
    scanf(" %d", &temp);
    if (x[temp] == -1) {
      x[temp] = i;
    } else {
      between = i - x[temp] - 1;
      break;
    }
  }

  for (i = 0; i <= n + 1; i++) {
    if (i > n + 1 - i) {
      combination[i] = combination[n + 1 - i];
    } else {
      combination[i] = calc_combi(n + 1, i);
    }
  }

  if (n == 1) {
    printf("1\n");
    printf("1\n");
  } else {
    printf("%d\n", n);
    for (i = 2; i <= n + 1; i++) {
      // answer = calc_combi(n - 1, i) + 2 * calc_combi(n - 1, i - 1) -
      //         calc_combi(n - 1 - between, i - 1) + calc_combi(n - 1, i -
      //         2);
      // answer = calc_combi(n + 1, i) - calc_combi(n - 1 - between, i - 1);
      answer = combinaion[i] - calc_combi(n - 1 - between, i - 1);
      printf("%llu\n", answer % TEISUU);
      fflush(stdout);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:78:7: error: 'combination' undeclared (first use in this function); did you mean 'combinarion'?
   78 |       combination[i] = combination[n + 1 - i];
      |       ^~~~~~~~~~~
      |       combinarion
main.c:78:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:94:16: error: 'combinaion' undeclared (first use in this function); did you mean 'combinarion'?
   94 |       answer = combinaion[i] - calc_combi(n - 1 - between, i - 1);
      |                ^~~~~~~~~~
      |                combinarion