Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

#define MOD 1000000007LL

long long factorial(long long n, long long mod) {
    long long ret = 1;
    for (long long i = 1; i <= n; i++) {
        ret = (ret * i) % mod;
    }
    return ret;
}

long long inv_mod(long long n, long long mod) {
    long long a = n % mod, b = mod - 2, ret = 1;
    while (b > 0) {
        if (b & 1) ret = (ret * a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return ret;
}

long long nPr(long long n, long long r, long long mod) {
    long long ret = 1;
    for (long long i = n; i >= n - r + 1; i--) {
        ret = ret * (i % mod) % mod;
    }
    return ret;
}

ll facts=[100001]

long long nCr(long long n, long long r, long long mod) {
    return nPr(n,r,mod) * inv_mod(factorial(r,mod),mod) % mod;
}
long long nCr2(long long n, long long r, long long mod) {
    return nPr(n,r,mod) * inv_mod(facts[r],mod) % mod;
}

long long nHr(long long n, long long r, long long mod) {
    return nCr(n+r-1,r,mod);
}

long long int le,ri;
long long int n;
long long int a[100001]={};
int main(){
    for(int i=0;i<100001;i++)facts[i]=factorial(i,mod);
    cin >> n;
    int po=0;
    for(int i=1;i<=n+1;i++){
      cin >> po;
      if(a[po]!=0){
        le=a[po]-1;
        ri=n+1-i;
      }
      a[po]=i;
    }
    for(int i=1;i<=n+1;i++){
        long long int po=nCr2(n+1,i,MOD);
        long long int sub=nCr2(le+ri,i-1,MOD);
        cout<<po-sub<<endl;
    }
    return 0;
}

Compiler output:
a.cc:50:11: error: expected identifier before numeric constant
   50 | ll facts=[100001]
      |           ^~~~~~
a.cc:52:1: error: type-specifier invalid in lambda
   52 | long long nCr(long long n, long long r, long long mod) {
      | ^~~~
a.cc:52:6: error: type-specifier invalid in lambda
   52 | long long nCr(long long n, long long r, long long mod) {
      |      ^~~~
a.cc:52:1: warning: parameter declaration before lambda declaration specifiers only optional with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   52 | long long nCr(long long n, long long r, long long mod) {
      | ^~~~
a.cc: In lambda function:
a.cc:52:11: error: expected '{' before 'nCr'
   52 | long long nCr(long long n, long long r, long long mod) {
      |           ^~~
a.cc: At global scope:
a.cc:50:10: error: invalid user-defined conversion from '<lambda()>' to 'll' {aka 'long long int'} [-fpermissive]
   50 | ll facts=[100001]
      |          ^~~~~~~~
   51 | 
      |           
   52 | long long nCr(long long n, long long r, long long mod) {
      | ~~~~~~~~~ 
a.cc:50:10: note: candidate is: 'constexpr<lambda()>::operator void (*)()() const' (near match)
   50 | ll facts=[100001]
      |          ^
a.cc:50:10: note:   no known conversion from 'void (*)()' to 'll' {aka 'long long int'}
a.cc:52:11: error: expected ',' or ';' before 'nCr'
   52 | long long nCr(long long n, long long r, long long mod) {
      |           ^~~
a.cc: In function 'long long int nCr2(long long int, long long int, long long int)':
a.cc:56:40: error: invalid types 'll {aka long long int}[long long int]' for array subscript
   56 |     return nPr(n,r,mod) * inv_mod(facts[r],mod) % mod;
      |                                        ^
a.cc: In function 'long long int nHr(long long int, long long int, long long int)':
a.cc:60:12: error: 'nCr' was not declared in this scope; did you mean 'nPr'?
   60 |     return nCr(n+r-1,r,mod);
      |            ^~~
      |            nPr
a.cc: In function 'int main()':
a.cc:67:35: error: invalid types 'll {aka long long int}[int]' for array subscript
   67 |     for(int i=0;i<100001;i++)facts[i]=factorial(i,mod);
      |                                   ^
a.cc:67:51: error: 'mod' was not declared in this scope; did you mean 'modf'?
   67 |     for(int i=0;i<100001;i++)facts[i]=factorial(i,mod);
      |                                                   ^~~
      |                                                   modf